Allows you to easily inline ignore your PHPStan errors via @phpstan-ignore
comment.
So instead of:
parameters:
ignoreErrors:
-
message: '#^Construct empty\(\) is not allowed\. Use more strict comparison\.$#'
identifier: empty.notAllowed
path: ../src/App/User.php
count: 1
You will have the ignored error directly in the source code src/App/User.php
:
class User {
public function updateSurname(string $surname): void
{
if (empty($surname)) { // @phpstan-ignore empty.notAllowed
throw new EmptyNameException();
}
}
}
composer require --dev shipmonk/phpstan-ignore-inliner
vendor/bin/phpstan --error-format=json | vendor/bin/inline-phpstan-ignores
- Check your code by
composer check
- Autofix coding-style by
composer fix:cs
- All functionality must be tested