1 | <?php |
||
13 | final class ReflectionClass extends \ReflectionClass |
||
14 | { |
||
15 | |||
16 | /** @var object */ |
||
17 | protected $object; |
||
18 | |||
19 | |||
20 | /** |
||
21 | * @param object|mixed $class |
||
22 | * @param object|mixed|null $object |
||
23 | * @throws \ReflectionException |
||
24 | */ |
||
25 | 11 | public function __construct($class, $object = null) |
|
37 | |||
38 | |||
39 | /** |
||
40 | * @param object|mixed $class |
||
41 | * @param object|mixed|null $object |
||
42 | * @return self |
||
|
|||
43 | * @throws \ReflectionException |
||
44 | */ |
||
45 | 8 | public static function from($class, $object = null): self |
|
49 | |||
50 | |||
51 | 1 | public function getObject() |
|
55 | |||
56 | |||
57 | /** |
||
58 | * @param string $method |
||
59 | * @param mixed[] $arguments |
||
60 | * @return mixed |
||
61 | */ |
||
62 | 1 | public function invokeMethod(string $method, array $arguments = []) |
|
73 | |||
74 | |||
75 | /** |
||
76 | * @param mixed $value |
||
77 | * @return self |
||
78 | */ |
||
79 | 1 | public function setPropertyValue(string $property, $value): self |
|
91 | |||
92 | |||
93 | /** |
||
94 | * @return mixed |
||
95 | */ |
||
96 | 2 | public function getPropertyValue(string $property) |
|
107 | |||
108 | |||
109 | /** |
||
110 | * @return self |
||
111 | * @throws \ReflectionException |
||
112 | */ |
||
113 | 1 | public function getParent(): self |
|
117 | } |
||
118 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.