Passed
Push — master ( b528f1...5646b8 )
by compolom
02:13
created

Caller::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
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 1
    public function setBase($base): void
14
    {
15 1
        $this->base = $base;
16 1
    }
17
18 1
    public function __call(string $method, $args)
19
    {
20 1
        if (!method_exists(__CLASS__, $method)) {
21 1
            return $this->base->$method(...$args);
22
        }
23
    }
24
25 1
    public function __toString()
26
    {
27 1
        return static::get();
28
    }
29
}
30