Passed
Push — master ( 1b043d...05e825 )
by compolom
05:48
created

Caller::__toString()   A

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
cc 1
eloc 2
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
namespace Compolomus\LSQLQueryBuilder\System\Traits;
4
5
trait Caller
6
{
7
    private $base;
8
9
    public function base($base): void
10
    {
11
        $this->base = $base;
12
    }
13
14
    public function __call(string $method, $args)
15
    {
16
        if (!method_exists(__CLASS__, $method)) {
17
            return $this->base->$method(...$args);
18
        }
19
    }
20
21
    public function __toString()
22
    {
23
        return static::get();
24
    }
25
}
26