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\Reflection\MethodReflection;
8:
9: /**
10: * This is the interface dynamic return type extensions implement for static methods.
11: *
12: * To register it in the configuration file use the `phpstan.broker.dynamicStaticMethodReturnTypeExtension` service tag:
13: *
14: * ```
15: * services:
16: * -
17: * class: App\PHPStan\MyExtension
18: * tags:
19: * - phpstan.broker.dynamicStaticMethodReturnTypeExtension
20: * ```
21: *
22: * Learn more: https://phpstan.org/developing-extensions/dynamic-return-type-extensions
23: *
24: * @api
25: */
26: interface DynamicStaticMethodReturnTypeExtension
27: {
28:
29: public function getClass(): string;
30:
31: public function isStaticMethodSupported(MethodReflection $methodReflection): bool;
32:
33: public function getTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, Scope $scope): ?Type;
34:
35: }
36: