1 | <?php |
||
9 | class Arr |
||
10 | { |
||
11 | /** |
||
12 | * A mapping of method names to the numbers of arguments it accepts. Each |
||
13 | * should be two more than the equivalent method. |
||
14 | * |
||
15 | * @var string[] |
||
16 | */ |
||
17 | protected $classes = [ |
||
18 | Access::class, |
||
19 | Enumerator::class, |
||
20 | Transform::class, |
||
21 | Traverse::class |
||
22 | ]; |
||
23 | |||
24 | protected $methodArgs = null; |
||
25 | |||
26 | /** |
||
27 | * Invokes the given method with the rest of the passed arguments. |
||
28 | * The result is not cast, so the return value may be of type Arr, array, |
||
29 | * integer, boolean, etc. |
||
30 | * |
||
31 | * @param string $name |
||
32 | * @param mixed[] $args |
||
33 | * |
||
34 | * @throws \BadMethodCallException |
||
35 | * @throws \RuntimeException |
||
36 | * |
||
37 | * @return mixed |
||
38 | */ |
||
39 | public function __call($name, $args) |
||
64 | |||
65 | /** |
||
66 | * Get all methods arguments. |
||
67 | * |
||
68 | * @param string $name |
||
69 | */ |
||
70 | protected function getMethodArgs($name) |
||
84 | |||
85 | /** |
||
86 | * Get function from the correct object. |
||
87 | * |
||
88 | * @param object $instance |
||
89 | * @param string $method |
||
90 | * @param array $args |
||
91 | * |
||
92 | * @return mixed |
||
93 | */ |
||
94 | protected function getFunction($instance, $method, $args) |
||
107 | } |
||
108 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.