Markus Staab
Markus Staab
pick this commit and you get a green build: https://github.com/staabm/phpstan-src/commit/333d1c4115c528eb41f563314385e606355cba5b problem is/was: the PR without this fix created unions with lots of elements in the ConstantArray types. this got either...
And pick https://github.com/staabm/phpstan-src/commit/4cbca5ecf291d9de74a715757e560fa05cdf23a8 on top to get `IntegerRangeType` support
I decided to [send a new PR](https://github.com/phpstan/phpstan-src/pull/4528), so I can see impact on issue-bot
@liamduckett I just realized that the fix of this PR produces a false-positive (see the newly added testcase). I do not yet know how to fix the initial problem without...
the initial types were wrongly narrowed: ``` /** * @param 'quux'|'qux' $constUnion */ function fooBar(object $bar, string $constUnion): void { if (!method_exists($bar, $constUnion)) { throw new \Exception; } // $bar...
Easy one: never use compact ;-)
ok, I see now that this new fix no longer fixes issues, which were [reported by issue-bot in the previous PR](https://github.com/phpstan/phpstan-src/actions/runs/19044800760). will look into it.
> I'd rather use [phar-io/version](https://github.com/phar-io/version?rgh-link-date=2025-12-08T08%3A45%3A02Z) which is also used by PHPUnit I think [sebastianbergmann/phpunit@`2d6dc60`/src/Metadata/Version/Requirement.php](https://github.com/sebastianbergmann/phpunit/blob/2d6dc600b52cd74141c422a5d0601ca26c185bb9/src/Metadata/Version/Requirement.php) thats only one part of the story. see also https://github.com/sebastianbergmann/phpunit/blob/2d6dc600b52cd74141c422a5d0601ca26c185bb9/src/Metadata/Version/Requirement.php#L41-L48 which adds a fallback path on...
> As I said, this either needs virtual nodes so you mean e.g. a `CallLikeArg` virtual node so we would hook a rule onto every arg and rework all callers...
> ambitious refactoring. this would mean something like a new `MutatingScope->enterCallLike()` method, right?