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

BuildMethod   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 83.33%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 0
dl 0
loc 19
ccs 5
cts 6
cp 0.8333
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 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