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