-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Optimize: Services #3463
Optimize: Services #3463
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes for email()
and encryption()
are necessary but for the other cases... I'm not sure if we should go with BaseConfig
or be more restrictive.
Personally, I prefer to use the more specific config class name as typehint instead of the generic |
Fair point, I think we can go with a specific class. |
I think we should also consider the case of #3475 for services. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can get all the type hints specified this looks good to me. I never knew that static protected
was even an acceptable syntax! I also never knew ?:
was called the "Elvis operator". TIL
Okay, it seems we all agree on the stricter types for @paulbalandan I looked at the Services file and we use |
I dont get how my changes affect Database Live tests. |
We're supposed to use the currently loaded instance of the config file. We should use I'm also wondering shouldn't we use an explicit declaration for the config types, like |
Oh. I'll look into this.
I don't know but shouldn't this be already known if you're using PHP OOP? For me, I don't prefer using FQCN in typehints. |
I think this is probably a matter of opinion. Personally unless there is some compelling reason otherwise I will put |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two tiny things.
This is looking good, and very close! Thanks you two. |
I don't know what the phpstan error means. @samsonasik ? |
@paulbalandan you can remove |
Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this!
Description
Remove unneeded lines of code by:
??
where possibleis_object
checks for nullable typehintsI have a failing test for
router
though I didn't touch that before:Checklist: