You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree that this section should be moved to the Functions section. But over the name of this section, i would have thought more. This section is about how to properly use default values for arguments, not how not to pass NULL.
First of all, I'm not actually sure that default arguments (or optional arguments) are a good design, by that's my opinion.
Regarding "clean code php", notice that when using polymorphism, you'd have to declare the default value multiple times (in the interface, and then in the implementations).
https://github.com/jupeter/clean-code-php#use-default-arguments-instead-of-short-circuiting-or-conditionals
I think, it's must be in "Functions" section and renamed with something like "Don't pass NULL arguments".
The text was updated successfully, but these errors were encountered: