jbboehr / phpstan-laravel-validation

Experimental phpstan plugin for Laravel Validation
GNU Affero General Public License v3.0
4 stars 1 forks source link

invalid type inference #12

Closed staabm closed 1 month ago

staabm commented 1 month ago

when using AccessoryTypes these need to be intersected with a main type

see e.g.

where you miss to intersect a AccessoryNonEmptyStringType with StringType

not doing so lead to false positives like https://github.com/phpstan/phpstan/issues/11535#issuecomment-2377258037


in e.g.

https://github.com/jbboehr/phpstan-laravel-validation/blob/7e20c3ed96ae50feecff87049a7ef85ed01408f6/src/Validation/TypeResolver.php#L157-L160

its correctly done

momala454 commented 1 month ago

I fixed it in my fork https://github.com/momala454/phpstan-laravel-validation

jbboehr commented 1 month ago

That was the subject of #9, I guess I missed a spot.

jbboehr commented 1 month ago

I cherry-picked @momala454's commits into master, should be fixed now. Thanks!