Bug report
With bleedingEdge enabled, a baseline generated by --generate-baseline doesn't ignore errors whose message starts with @. The next run reports the original error again, and the baseline entry is reported as unmatched. Regenerating the baseline doesn't help.
This works in 2.2.5 and fails from 2.2.6 up to 2.2.16.
Reproduction
src/Foo.php:
<?php
declare(strict_types = 1);
namespace App;
final class Foo
{
/** @readonly */
public int $bar = 1;
}
phpstan.neon:
includes:
- phar://phpstan.phar/conf/bleedingEdge.neon
- phpstan-baseline.neon
parameters:
level: 0
paths:
- src
touch phpstan-baseline.neon
vendor/bin/phpstan analyse --generate-baseline
vendor/bin/phpstan analyse
Generated baseline:
parameters:
ignoreErrors:
-
rawMessage: @@readonly property cannot have a default value.
identifier: property.readOnlyByPhpDocDefaultValue
count: 1
path: src/Foo.php
Actual output (2.2.6 – 2.2.16)
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Line Foo.php
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Ignored error "@@readonly property cannot have a default value." (property.readOnlyByPhpDocDefaultValue) in path /home/andrew/web/phpstan-bug/src/Foo.php was not matched in reported errors.
🪪 ignore.unmatched (non-ignorable)
at src/Foo.php:0
11 @readonly property cannot have a default value.
🪪 property.readOnlyByPhpDocDefaultValue
at src/Foo.php:11
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Environment
- PHPStan 2.2.16
- PHP 8.4.24
Code snippet that reproduces the problem
No response
Expected output
[OK] No errors, as in 2.2.5.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan makes me happy every day!
Bug report
With bleedingEdge enabled, a baseline generated by
--generate-baselinedoesn't ignore errors whose message starts with@. The next run reports the original error again, and the baseline entry is reported as unmatched. Regenerating the baseline doesn't help.This works in 2.2.5 and fails from 2.2.6 up to 2.2.16.
Reproduction
src/Foo.php:phpstan.neon:Generated baseline:
Actual output (2.2.6 – 2.2.16)
Environment
Code snippet that reproduces the problem
No response
Expected output
[OK] No errors, as in 2.2.5.Did PHPStan help you today? Did it make you happy in any way?
PHPStan makes me happy every day!