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
@@ @@+PHP 8.0 – 8.3 (2 errors)+==========+
29: Call to static method Foo::assertTrue() with true will always evaluate to true.
-30: Call to static method Foo::assertSame() with true and true will always evaluate to true.+30: Call to static method Foo::assertSame() with true and true will always evaluate to true.++PHP 7.2 – 7.4 (12 errors)+==========++10: Asserted type true for $condition with type mixed can never happen.+10: Parameter $condition of method Foo::assertTrue() has invalid type mixed.+23: PHPDoc tag @param for parameter $expected with type ExpectedType is not subtype of native type mixed.+23: Parameter $actual of method Foo::assertSame() has invalid type mixed.+23: Parameter $expected of method Foo::assertSame() has invalid type mixed.+23: Template type ExpectedType of method Foo::assertSame() is not referenced in a parameter.+29: Call to static method Foo::assertTrue() with true will always evaluate to true.+29: Parameter #1 $condition of static method Foo::assertTrue() expects mixed|null, true given.+30: Parameter #1 $expected of static method Foo::assertSame() expects mixed|null, true given.+30: Parameter #2 $actual of static method Foo::assertSame() expects mixed|null, true given.+31: Parameter #1 $expected of static method Foo::assertSame() expects mixed|null, string given.+31: Parameter #2 $actual of static method Foo::assertSame() expects mixed|null, string given.
Full report
PHP 8.0 – 8.3 (2 errors)
Line
Error
29
Call to static method Foo::assertTrue() with true will always evaluate to true.
30
Call to static method Foo::assertSame() with true and true will always evaluate to true.
PHP 7.2 – 7.4 (12 errors)
Line
Error
10
Asserted type true for $condition with type mixed can never happen.
10
Parameter $condition of method Foo::assertTrue() has invalid type mixed.
23
PHPDoc tag @param for parameter $expected with type ExpectedType is not subtype of native type mixed.
23
Parameter $actual of method Foo::assertSame() has invalid type mixed.
23
Parameter $expected of method Foo::assertSame() has invalid type mixed.
23
Template type ExpectedType of method Foo::assertSame() is not referenced in a parameter.
29
Call to static method Foo::assertTrue() with true will always evaluate to true.
29
`Parameter #1 $condition of static method Foo::assertTrue() expects mixed
30
`Parameter #1 $expected of static method Foo::assertSame() expects mixed
30
`Parameter #2 $actual of static method Foo::assertSame() expects mixed
31
`Parameter #1 $expected of static method Foo::assertSame() expects mixed
31
`Parameter #2 $actual of static method Foo::assertSame() expects mixed
Activity
phpstan-bot commentedon Sep 4, 2024
@mvorisek After the latest push in 2.0.x, PHPStan now reports different result with your code snippet:
Full report
PHP 8.0 – 8.3 (2 errors)
Call to static method Foo::assertTrue() with true will always evaluate to true.Call to static method Foo::assertSame() with true and true will always evaluate to true.PHP 7.2 – 7.4 (12 errors)
Asserted type true for $condition with type mixed can never happen.Parameter $condition of method Foo::assertTrue() has invalid type mixed.PHPDoc tag @param for parameter $expected with type ExpectedType is not subtype of native type mixed.Parameter $actual of method Foo::assertSame() has invalid type mixed.Parameter $expected of method Foo::assertSame() has invalid type mixed.Template type ExpectedType of method Foo::assertSame() is not referenced in a parameter.Call to static method Foo::assertTrue() with true will always evaluate to true.ondrejmirtes commentedon Dec 10, 2024
I'd say this already works.
mvorisek commentedon Dec 10, 2024
@ondrejmirtes this issue is about l31 which does not emit a PHPStan error.
phpstan-bot commentedon Sep 16, 2025
@mvorisek After the latest push in 2.1.x, PHPStan now reports different result with your code snippet:
Full report
PHP 8.0 – 8.4 (1 error)
Call to static method Foo::assertTrue() with true will always evaluate to true.PHP 7.2 – 7.4 (12 errors)
Asserted type true for $condition with type mixed can never happen.Parameter $condition of method Foo::assertTrue() has invalid type mixed.PHPDoc tag @param for parameter $expected with type ExpectedType is not subtype of native type mixed.Parameter $actual of method Foo::assertSame() has invalid type mixed.Parameter $expected of method Foo::assertSame() has invalid type mixed.Template type ExpectedType of method Foo::assertSame() is not referenced in a parameter.Call to static method Foo::assertTrue() with true will always evaluate to true.