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