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

BuildMethod   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 19
wmc 2
lcom 1
cbo 0
ccs 0
cts 10
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 11 2
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