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
Avoid type-checking doesn't address a realistic situation in which one might do type checking. If type declaration can be used that's great, but often it's not the case.
In the second case, it's likely for the code to work without an error as first, but result in an unexpected error or, event worst, an unexpected result later.
No type checking goes against the "Fail fast" principle, which prevents you having to chase bugs through the code.
While static code analysis does a good job, it doesn't capture all issues.
The argument about it being to verbose isn't that strong, as you have many solutions to write it as one line. For instance with beberlei/assert.
The text was updated successfully, but these errors were encountered:
Avoid type-checking doesn't address a realistic situation in which one might do type checking. If type declaration can be used that's great, but often it's not the case.
One major issue that PHP doesn't support union or intersection types.
Again in the second example
In the second case, it's likely for the code to work without an error as first, but result in an unexpected error or, event worst, an unexpected result later.
No type checking goes against the "Fail fast" principle, which prevents you having to chase bugs through the code.
While static code analysis does a good job, it doesn't capture all issues.
The argument about it being to verbose isn't that strong, as you have many solutions to write it as one line. For instance with beberlei/assert.
The text was updated successfully, but these errors were encountered: