Completed
Push — master ( 603fa9...c5e232 )
by Daniel
03:00
created

Arr::__call()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 14
rs 9.2
cc 4
eloc 10
nc 4
nop 2
1
<?php
2
namespace Narrowspark\Arr;
3
4
class Arr
5
{
6
    public function __call($name, $arguments)
7
    {
8
        $access     = new Access();
9
        $enumerator = new Enumerator();
10
        $transform  = new Transform();
11
12
        if (condition) {
13
            return call_user_func_array([$access, $name], $args);
0 ignored issues
show
Bug introduced by
The variable $args does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
14
        } else if (condition) {
15
            return call_user_func_array([$enumerator, $name], $args);
16
        } else if (condition) {
17
            return call_user_func_array([$transform, $name], $args);
18
        }
19
    }
20
}
21