1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\PhpDoc;
4:
5: use PHPStan\Analyser\NameScope;
6: use PHPStan\PhpDocParser\Ast\Type\TypeNode;
7: use PHPStan\Type\Type;
8:
9: /**
10: * This is the interface type node resolver extensions implement for custom PHPDoc types.
11: *
12: * To register it in the configuration file use the `phpstan.phpDoc.typeNodeResolverExtension` service tag:
13: *
14: * ```
15: * services:
16: * -
17: * class: App\PHPStan\MyExtension
18: * tags:
19: * - phpstan.phpDoc.typeNodeResolverExtension
20: * ```
21: *
22: * Learn more: https://phpstan.org/developing-extensions/custom-phpdoc-types
23: *
24: * @api
25: */
26: interface TypeNodeResolverExtension
27: {
28:
29: public const EXTENSION_TAG = 'phpstan.phpDoc.typeNodeResolverExtension';
30:
31: public function resolve(TypeNode $typeNode, NameScope $nameScope): ?Type;
32:
33: }
34: