phpstan / phpstan-symfony

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

Add missing `@method` to ConstraintViolationInterface #385

Closed VincentLanglet closed 4 months ago

VincentLanglet commented 6 months ago

Not sure it's a wanted behavior, but if the stub does not declare all the @method annotation of the original file, method are considered as undefined. So I add them.

VincentLanglet commented 4 months ago

Friendly ping @ondrejmirtes

ondrejmirtes commented 4 months ago

I don' see these methods here https://github.com/symfony/symfony/blob/7.1/src/Symfony/Component/Validator/ConstraintViolationInterface.php I don't see why the stub should have them.

VincentLanglet commented 4 months ago

I don' see these methods here symfony/symfony@7.1/src/Symfony/Component/Validator/ConstraintViolationInterface.php I don't see why the stub should have them.

getConstraint is here https://github.com/symfony/symfony/blob/9b323c6866078f1bc761d7cc34297c41815108d3/src/Symfony/Component/Validator/ConstraintViolationInterface.php#L116

getCause is here https://github.com/symfony/symfony/blob/9b323c6866078f1bc761d7cc34297c41815108d3/src/Symfony/Component/Validator/ConstraintViolationInterface.php#L121

On 6.4 it's added as a @method https://github.com/symfony/symfony/blob/a10cc016321e36d32ffb3d016e0db89eb91a41a7/src/Symfony/Component/Validator/ConstraintViolationInterface.php#L34-L35

ondrejmirtes commented 4 months ago

Please next time link them in the first message so I don't have to hunt for them myself. Thank you.

VincentLanglet commented 3 months ago

Hi @ondrejmirtes this has been lost in the 1.4.x branch https://github.com/phpstan/phpstan-symfony/blob/1.4.x/stubs/Symfony/Component/Validator/ConstraintViolationInterface.stub

Should I open another PR or is there some merge to do from 1.3.x to 1.4.x ?

Thanks

ondrejmirtes commented 3 months ago

Merged 1.3.x into 1.4.x right now, sorry for forgetting.

VincentLanglet commented 3 months ago

Merged 1.3.x into 1.4.x right now, sorry for forgetting.

No problem, thanks a lot for your reactivity. You're doing such a good job.