Completed
Push — master ( 5649ba...c37d73 )
by recca
03:09
created

HigherOrderTapProxy::__call()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Recca0120\Repository;
4
5
class HigherOrderTapProxy
6
{
7
    /**
8
     * The target being tapped.
9
     *
10
     * @var mixed
11
     */
12
    public $target;
13
14
    /**
15
     * Create a new tap proxy instance.
16
     *
17
     * @param  mixed  $target
18
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
19
     */
20
    public function __construct($target)
21
    {
22
        $this->target = $target;
23
    }
24
25
    /**
26
     * Dynamically pass method calls to the target.
27
     *
28
     * @param  string  $method
29
     * @param  array  $parameters
30
     * @return mixed
31
     */
32
    public function __call($method, $parameters)
33
    {
34
        call_user_func_array([$this->target, $method], $parameters);
35
36
        return $this->target;
37
    }
38
}
39