forked from phpstan/phpstan-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethodParameterOutTypeExtension.php
More file actions
34 lines (28 loc) · 1009 Bytes
/
Copy pathMethodParameterOutTypeExtension.php
File metadata and controls
34 lines (28 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php declare(strict_types = 1);
namespace PHPStan\Type;
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\DependencyInjection\ExtensionInterface;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Reflection\ParameterReflection;
/**
* This is the interface dynamic parameter out type extensions implement for non-static methods.
*
* To register it in the configuration file use the `phpstan.methodParameterOutTypeExtension` service tag:
*
* ```
* services:
* -
* class: App\PHPStan\MyExtension
* tags:
* - phpstan.methodParameterOutTypeExtension
* ```
*
* @api
*/
#[ExtensionInterface(tag: 'phpstan.methodParameterOutTypeExtension')]
interface MethodParameterOutTypeExtension
{
public function isMethodSupported(MethodReflection $methodReflection, ParameterReflection $parameter): bool;
public function getParameterOutTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, ParameterReflection $parameter, Scope $scope): ?Type;
}