Completed
Push — master ( 755d2f...4eddf0 )
by Christopher
05:22
created

BuildMethod::build()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 11
ccs 0
cts 10
cp 0
rs 9.4286
cc 2
eloc 6
nc 2
nop 0
crap 6
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
    public function build()
18
    {
19
        if (!isset($this->query)) {
20
            throw new LogicException("build() called before select(), insert(), update() or delete()");
21
        }
22
23
        return [
24
            $this->query->getStatement(),
25
            $this->query->getBindValues(),
26
        ];
27
    }
28
}
29