phpstan / phpstan-symfony

Symfony extension for PHPStan
MIT License
698 stars 89 forks source link

Add stub for Compound::getConstraints() #388

Closed derrabus closed 4 months ago

derrabus commented 4 months ago

This PR fixes a error people get when implementing compound constraints:

Method App\Validator\Constraints\MyConstraint::getConstraints() has parameter $options with no value type specified in iterable type array.

Symfony does not document the structure of the $options array, which can be an array of anything.

ondrejmirtes commented 4 months ago

Thank you! :)

VincentLanglet commented 4 months ago

Symfony does not document the structure of the $options array, which can be an array of anything.

Looking at the usage, I think it should be array<string, mixed> rather than array<mixed>

I created https://github.com/symfony/symfony/pull/54574 to validate the point @derrabus.

derrabus commented 4 months ago

Thank you for opening the PR upstream. I've left a comment.