-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(router): convert route attributes to plain objects #822
Conversation
Cool PR! |
Nice! |
PHPStan seems drunk, can someone rerun it? It reports an error of unnecessary null safe, while on that line (and even in the file) no nullsafe operators are used... |
7ef7d99
to
0330837
Compare
@blackshadev I reran it from mobile, but same error. What file/line is it complaining about? It's not complaining locally? |
It is not, but I found out why. Somebody other than me rebased this branch from main , which contained the new error. I rebased the phpstan-v2 branch and added the error to the baseline. I will rebase this one to phpstan-v2 and it should be green. |
0330837
to
c7eacd7
Compare
Very nice! |
Do we need to update the docs as well? |
A bit. I can do it tomorrow. |
updated docs in this PR |
What
@aidan-casey made an alternative suggestion to removing the
Route
as abstract base. With this rework we also lose theIsRoute
trait and allRoute
builder "verbs" (Get
,Post
, etc) become plain old php objects. No method, no logic, no magic. This will make it easier to use theRoute
interface. But it will make it "harder" to do logic in these Route builder "verbs" as you do not have any method to hook into, you should do everything in the constructor.Personally, I think this is as clean as it gets.
DO NOT MERGE
Based on #821 as PHPStan 2.0 is required, the old one will panic at the sight of property hooks in the interface