SimpleDelegator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 19
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
delegatee() 0 1 ?
A __get() 0 4 1
A __set() 0 4 1
A __call() 0 4 1
1
<?php
2
3
namespace N7olkachev\SimpleDelegator;
4
5
trait SimpleDelegator
6
{
7
    abstract protected function delegatee();
8
9
    public function __get($key)
10
    {
11
        return $this->delegatee()->$key;
12
    }
13
14
    public function __set($key, $value)
15
    {
16
        return $this->delegatee()->$key = $value;
17
    }
18
19
    public function __call($key, $args)
20
    {
21
        return $this->delegatee()->$key(...$args);
22
    }
23
}
24