Passed
Push — master ( 3ae7db...b528f1 )
by compolom
03:44
created

Caller::setBase()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Compolomus\LSQLQueryBuilder\System\Traits;
4
5
/**
6
 * @method string table()
7
 * @method void addPlaceholders($placeholders)
8
 */
9
trait Caller
10
{
11
    private $base;
12
13
    public function setBase($base): void
14
    {
15
        $this->base = $base;
16
    }
17
18
    public function __call(string $method, $args)
19
    {
20
        if (!method_exists(__CLASS__, $method)) {
21
            return $this->base->$method(...$args);
22
        }
23
    }
24
25
    public function __toString()
26
    {
27
        return static::get();
28
    }
29
}
30