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 $callable |
||
33 | */ |
||
34 | 50 | public function __construct($callable) |
|
38 | |||
39 | /** |
||
40 | * @return callable |
||
41 | */ |
||
42 | 36 | public function callable() |
|
46 | |||
47 | /** |
||
48 | * @return bool |
||
49 | */ |
||
50 | 32 | public function isFunction(): bool |
|
54 | |||
55 | /** |
||
56 | * @return ReflectionFunctionAbstract|ReflectionMethod|ReflectionFunction |
||
57 | */ |
||
58 | 30 | public function reflection(): ReflectionFunctionAbstract |
|
68 | |||
69 | /** |
||
70 | * @param $callable |
||
71 | * @return callable |
||
|
|||
72 | * @throws InvalidArgumentException |
||
73 | */ |
||
74 | 50 | private function normalizeCallable($callable) |
|
111 | } |
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.