1 | <?php declare(strict_types = 1); |
||
16 | class Invokable |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var callable |
||
21 | */ |
||
22 | private $callable; |
||
23 | |||
24 | /** |
||
25 | * @var ReflectionFunctionAbstract |
||
26 | */ |
||
27 | private $reflection; |
||
28 | |||
29 | /** |
||
30 | * ReflectedCallable constructor. |
||
31 | * |
||
32 | * @param callable|ReflectionFunctionAbstract $callable |
||
33 | */ |
||
34 | 62 | public function __construct($callable) |
|
43 | |||
44 | /** |
||
45 | * @return callable |
||
46 | */ |
||
47 | 49 | public function callable() |
|
51 | |||
52 | /** |
||
53 | * @return bool |
||
54 | */ |
||
55 | 40 | public function isFunction(): bool |
|
59 | |||
60 | /** |
||
61 | * @return ReflectionFunctionAbstract|ReflectionMethod|ReflectionFunction |
||
62 | */ |
||
63 | 39 | public function reflection(): ReflectionFunctionAbstract |
|
73 | |||
74 | /** |
||
75 | * @param $callable |
||
76 | * @return callable |
||
|
|||
77 | * @throws InvalidArgumentException |
||
78 | */ |
||
79 | 53 | private function normalizeCallable($callable) |
|
116 | |||
117 | /** |
||
118 | * @param ReflectionFunctionAbstract $reflection |
||
119 | * @return array|Closure|string |
||
120 | * @throws InvalidArgumentException |
||
121 | */ |
||
122 | 13 | private function reflectionCallable(ReflectionFunctionAbstract $reflection) |
|
133 | } |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.