forked from phpstan/phpstan-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethodTypeSpecifyingExtension.php
More file actions
38 lines (31 loc) · 1.06 KB
/
Copy pathMethodTypeSpecifyingExtension.php
File metadata and controls
38 lines (31 loc) · 1.06 KB
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
35
36
37
38
<?php declare(strict_types = 1);
namespace PHPStan\Type;
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\Analyser\SpecifiedTypes;
use PHPStan\Analyser\TypeSpecifierContext;
use PHPStan\Reflection\MethodReflection;
/**
* This is the interface type-specifying extensions implement for non-static methods.
*
* To register it in the configuration file use the `phpstan.typeSpecifier.methodTypeSpecifyingExtension` service tag:
*
* ```
* services:
* -
* class: App\PHPStan\MyExtension
* tags:
* - phpstan.typeSpecifier.methodTypeSpecifyingExtension
* ```
*
* Learn more: https://phpstan.org/developing-extensions/type-specifying-extensions
*
* @api
*/
interface MethodTypeSpecifyingExtension
{
/** @return class-string */
public function getClass(): string;
public function isMethodSupported(MethodReflection $methodReflection, MethodCall $node, TypeSpecifierContext $context): bool;
public function specifyTypes(MethodReflection $methodReflection, MethodCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes;
}