forked from phpstan/phpstan-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethodReflection.php
More file actions
58 lines (45 loc) · 1.63 KB
/
Copy pathMethodReflection.php
File metadata and controls
58 lines (45 loc) · 1.63 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php declare(strict_types = 1);
namespace PHPStan\Reflection;
use PHPStan\TrinaryLogic;
use PHPStan\Type\Type;
/**
* Reflection for a class method.
*
* This is the interface extension developers should implement when creating custom
* MethodsClassReflectionExtension implementations for magic methods (__call, etc.).
*
* Methods can have multiple "variants" (overloaded signatures) — for example,
* built-in functions like `array_map` have different signatures depending on
* the number of arguments. Each variant is a ParametersAcceptor.
*
* For additional method metadata (assertions, purity, named arguments, attributes),
* see ExtendedMethodReflection which extends this interface.
*
* @api
*/
interface MethodReflection extends ClassMemberReflection
{
public function getName(): string;
/**
* For methods that override a parent method, this returns the parent's
* method reflection. For methods with no parent, returns itself.
*/
public function getPrototype(): ClassMemberReflection;
/**
* Most methods have a single variant. Built-in PHP functions with overloaded
* signatures (e.g. different return types based on argument count) have multiple.
*
* @return list<ParametersAcceptor>
*/
public function getVariants(): array;
public function isDeprecated(): TrinaryLogic;
public function getDeprecatedDescription(): ?string;
public function isFinal(): TrinaryLogic;
public function isInternal(): TrinaryLogic;
public function getThrowType(): ?Type;
/**
* Void methods are always considered impure since they must do something
* to be useful.
*/
public function hasSideEffects(): TrinaryLogic;
}