-
Notifications
You must be signed in to change notification settings - Fork 35
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
Form events errors #82
Comments
Given the types from the stub: phpstan-nette/stubs/Forms/Form.stub Lines 8 to 9 in f4654b2
/** @var array<callable(static, mixed): void> */
public $onSuccess; this is expected behaviour by PHPStan. Because you're narrowing down the type of the second parameter from I understand that Nette contains some magic (https://github.com/nette/forms/blob/0f0c770db65ce2a18fc766b8b718b53e081ac8e2/src/Forms/Form.php#L424-L442) that will prevent this bug from happening. But PHPStan currently doesn't have the facilities to describe this behaviour, so feel free to just ignore the error: https://phpstan.org/user-guide/ignoring-errors |
I just noticed this with Would changing the stubs to just Comparison of the various type signatures: https://phpstan.org/r/a8969a90-ac6f-47f6-b11f-8df10e8f7e95 |
@martenb I solved this with a custom /** @property array<callable(self, \Nette\Utils\ArrayHash $values): void> $onSuccess */
class Form extends \Nette\Application\UI\Form
{} |
Hi, i have problems with latest nette/forms and phpstan 1.0.. i will describe it on presenter, but same errors are in control...
The text was updated successfully, but these errors were encountered: