psalm
psalm copied to clipboard
Missing class constant not detected by any error level
https://psalm.dev/r/fa2b6244a3 - no error
https://phpstan.org/r/a6ff88e7-2e26-4f3a-a7ed-9c48ef0ddf07 - properly detected by phpstan
I found these snippets:
https://psalm.dev/r/fa2b6244a3
<?php
class A { const AA = 10; }
class B { }
class C
{
/** @var A|B */
var $a;
/** @param A|B $a */
function __construct($a) { $this->a = $a; }
function test(): void { $this->a::AA; }
}
$c = new C(new B);
$c->test();
Psalm output (using commit ef3b018):
No issues!