1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Type;
4:
5: use PhpParser\Node\Expr\StaticCall;
6: use PHPStan\Analyser\DependencyTracker;
7: use PHPStan\Analyser\Scope;
8: use PHPStan\DependencyInjection\ExtensionInterface;
9: use PHPStan\Reflection\MethodReflection;
10: use PHPStan\Reflection\ParameterReflection;
11:
12: /**
13: * This is the interface dynamic parameter out type extensions implement for static methods.
14: *
15: * To register it in the configuration file use the `phpstan.staticMethodParameterOutTypeExtension` service tag:
16: *
17: * ```
18: * services:
19: * -
20: * class: App\PHPStan\MyExtension
21: * tags:
22: * - phpstan.staticMethodParameterOutTypeExtension
23: * ```
24: *
25: * @api
26: */
27: #[ExtensionInterface(tag: 'phpstan.staticMethodParameterOutTypeExtension')]
28: interface StaticMethodParameterOutTypeExtension
29: {
30:
31: public function isStaticMethodSupported(MethodReflection $methodReflection, ParameterReflection $parameter): bool;
32:
33: public function getParameterOutTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, ParameterReflection $parameter, Scope&DependencyTracker $scope): ?Type;
34:
35: }
36: