1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Analyser;
4:
5: use PhpParser\Node;
6: use PHPStan\DependencyInjection\ExtensionInterface;
7:
8: /**
9: * This is the extension interface to implement if you want to ignore errors
10: * based on the node and scope.
11: *
12: * To register it in the configuration file use the `phpstan.ignoreErrorExtension` service tag:
13: *
14: * ```
15: * services:
16: * -
17: * class: App\PHPStan\MyExtension
18: * tags:
19: * - phpstan.ignoreErrorExtension
20: * ```
21: *
22: * Learn more: https://phpstan.org/developing-extensions/ignore-error-extensions
23: *
24: * @api
25: */
26: #[ExtensionInterface(tag: self::EXTENSION_TAG)]
27: interface IgnoreErrorExtension
28: {
29:
30: public const EXTENSION_TAG = 'phpstan.ignoreErrorExtension';
31:
32: public function shouldIgnore(Error $error, Node $node, Scope $scope): bool;
33:
34: }
35: