Skip to content

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