You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@param with union type of T|Closure(): T returns false positive #7049
changed the title [-]@param with union type of template type and a Closure that returns template type returns false positive[/-][+]@param with union type of T|Closure(): T returns false positive[/+]on Apr 17, 2022
@@ @@-PHP 8.0 – 8.1 (1 error)+PHP 8.0 – 8.1 (2 errors)
==========
+17: Call to method Collection::groupBy() on a separate line has no effect.
17: Unable to resolve the template type TGroupKey in call to method Collection::groupBy()
-PHP 7.1 – 7.4 (2 errors)+PHP 7.1 – 7.4 (3 errors)
==========
10: Method Collection::groupBy() uses native union types but they're supported only on PHP 8.0 and later.
+17: Call to method Collection::groupBy() on a separate line has no effect.
17: Unable to resolve the template type TGroupKey in call to method Collection::groupBy()
Full report
PHP 8.0 – 8.1 (2 errors)
Line
Error
17
Call to method Collection::groupBy() on a separate line has no effect.
17
Unable to resolve the template type TGroupKey in call to method Collection::groupBy()
PHP 7.1 – 7.4 (3 errors)
Line
Error
10
Method Collection::groupBy() uses native union types but they're supported only on PHP 8.0 and later.
17
Call to method Collection::groupBy() on a separate line has no effect.
17
Unable to resolve the template type TGroupKey in call to method Collection::groupBy()
Activity
[-]@param with union type of template type and a Closure that returns template type returns false positive[/-][+]@param with union type of T|Closure(): T returns false positive[/+]phpstan-bot commentedon Mar 4, 2025
@taka-oyama After the latest push in 2.1.x, PHPStan now reports different result with your code snippet:
Full report
PHP 8.0 – 8.1 (2 errors)
Call to method Collection::groupBy() on a separate line has no effect.Unable to resolve the template type TGroupKey in call to method Collection::groupBy()PHP 7.1 – 7.4 (3 errors)
Method Collection::groupBy() uses native union types but they're supported only on PHP 8.0 and later.Call to method Collection::groupBy() on a separate line has no effect.Unable to resolve the template type TGroupKey in call to method Collection::groupBy()phpstan-bot commentedon Sep 9, 2026
Closed via merging phpstan/phpstan-src#6376
github-actions commentedon Oct 11, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.