shipmonk/phpstan-ignore-inliner

Inline your PHPStan error ignores into the source files via @phpstan-ignore comments.

dev-master 2025-05-20 11:28 UTC

This package is auto-updated.

Last update: 2025-05-23 17:27:29 UTC


README

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();
        }
    }

}

Installation:

composer require --dev shipmonk/phpstan-ignore-inliner

Usage

vendor/bin/phpstan --error-format=json | vendor/bin/inline-phpstan-ignores

Contributing

  • Check your code by composer check
  • Autofix coding-style by composer fix:cs
  • All functionality must be tested