-
-
Notifications
You must be signed in to change notification settings - Fork 947
Anonymous class phpdoc is not parsed #7345
Copy link
Copy link
Closed
Labels
Description
Bug report
#[\AllowDynamicProperties]
class Cl {}
/**
* @property int $prop
*/
$a = new class() extends Cl {};
$a->prop = 10;
var_dump($a->prop);
var_dump((new \ReflectionClass($a))->getDocComment());
the php recognizes the phpdoc class comment correctly and all code that relies on phpdoc annotation too, so I submit it as a bug
real usecase/testcase https://github.com/mvorisek/atk4-hintable-mirror/blob/24951ac3d1a0a4a9beb7a8ed6c5790ea76a4176e/tests/Data/HintableModelArrayTest.php#L62-L84
Code snippet that reproduces the problem
https://phpstan.org/r/02bc0432-1c81-4868-95ae-cd1d4b276578
Expected output
no error
Reactions are currently unavailable