Markus Staab

Results 1075 comments of Markus Staab
trafficstars

> Does a transformation of int to a benevolent union of float|int I had the same thing in mind

> I tried adding `/** @var int|float $c */` but this didn't help. I would suggest ignoring the error inline by identifier: https://phpstan.org/r/0aa70a5c-5ca0-4456-a31c-01398d7e9bcf

@herndlm case `three` was recently fixed due to your changes. maybe case `two` is something in the same field you could look into?

Issue should be re-opened, I guess.

> This accessory type has to be in an IntersectionType along with StringType. would it be worth adding a check to `TypeCombinator::union` that args passed in cannot be a accessory...

this one is not yet done. the referenced PR only implemented `>` and `

We should just skip partial regex. Only validate in case we are certain enough we have a full regex at hand

related code for the fix is in https://github.com/phpstan/phpstan-src/blob/d1cf59a4ad16ae12ec1305d980142e4d5d2fe234/src/Analyser/NodeScopeResolver.php#L794-L860 I did a inital analysis, but wasn't able to find the root cause.

One way to fix this would be implementing a new string accessory type `NonZeroStringType`. https://github.com/phpstan/phpstan-src/commit/6ef5e91effcbc5c5b3f49cd2cf423d67044b8941 might be useful as inspiration which implemented `NonEmptyStringType` Maybe also https://github.com/phpstan/phpstan-src/pull/1542