Completed
Push — master ( d819e3...4fe283 )
by Christopher
03:01 queued 12s
created

BuildMethod::build()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.0185

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 11
ccs 5
cts 6
cp 0.8333
rs 9.4286
cc 2
eloc 6
nc 2
nop 0
crap 2.0185
1
<?php
2
3
namespace AsyncPHP\Icicle\Database\Builder\Method;
4
5
use LogicException;
6
7
/**
8
 * @property AbstractQuery $query
9
 */
10
trait BuildMethod
11
{
12
    /**
13
     * @return array
14
     *
15
     * @throws LogicException
16
     */
17 1
    public function build()
18
    {
19 1
        if (!isset($this->query)) {
20
            throw new LogicException("build() called before select(), insert(), update() or delete()");
21
        }
22
23
        return [
24 1
            $this->query->getStatement(),
25 1
            $this->query->getBindValues(),
26 1
        ];
27
    }
28
}
29