-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#2178Description
Bug report
We expect the @phpstan-readonly-allow-private-mutation property array to be appended for the following use cases.
refs #7778, phpstan/phpstan-src#1391
https://psalm.dev/docs/annotating_code/supported_annotations/#psalm-allow-private-mutation
Code snippet that reproduces the problem
<?php declare(strict_types = 1);
class ArrayLogger
{
/**
* @phpstan-readonly-allow-private-mutation
* @var list<mixed>
*/
public array $logs = [];
public function log(mixed $data): void
{
$this->logs[] = $data;
}
}https://phpstan.org/r/a7a757b2-c0cf-48a1-8402-125db9b4a37f
Expected output
No errors.
Did PHPStan help you today? Did it make you happy in any way?
Your fastest merge and release made me happy 😄
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels