Skip to content
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

Bump PHPStan to 2.0 #115

Merged
merged 3 commits into from
Jan 17, 2025
Merged

Bump PHPStan to 2.0 #115

merged 3 commits into from
Jan 17, 2025

Conversation

jtojnar
Copy link
Collaborator

@jtojnar jtojnar commented Jan 11, 2025

nette/forms 3.1.15 clarified that the `Container::getForm` method can only return `null` when passed `throw: false`:
nette/forms@ee43bfc

With PHPStan 2.0 this would be noticed and result in an error:

    384    Strict comparison using !== between Nette\Forms\Form and null will always evaluate to   true.
           🪪  notIdentical.alwaysTrue
Let’s use non-throwing variant and also add the PHPDoc to be explicit.
@jtojnar jtojnar marked this pull request as ready for review January 17, 2025 23:05
@jtojnar jtojnar merged commit 9533530 into master Jan 17, 2025
5 of 17 checks passed
@jtojnar jtojnar deleted the phpstan-2 branch January 17, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant