SimpleDelegator::__set()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
nc 1
cc 1
eloc 2
nop 2
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