Skip to content

Use a null default value in DeclarationBlock::parse() instead of false #975

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

Closed
oliverklee opened this issue Feb 24, 2025 · 0 comments · Fixed by #988
Closed

Use a null default value in DeclarationBlock::parse() instead of false #975

oliverklee opened this issue Feb 24, 2025 · 0 comments · Fixed by #988

Comments

@oliverklee
Copy link
Collaborator

#972 (review)

JakeQZ added a commit that referenced this issue Feb 25, 2025
The variable is either a string or it isn't.
The best practice for when it isn't is for it to be `null` or `unset()`.

Using `false` for when it isn't can lead to type-safety issues.
Reference:
https://vulke.medium.com/when-should-variables-be-null-false-undefined-or-an-empty-string-in-php-4ebd73c7a954

Also use `===` in a comparison in the affected code.

Resolves #975.
Part of #976.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant