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

HigherOrderTapProxy   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __call() 0 6 1
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