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

MySQLBuilder::factory()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4286
cc 2
eloc 4
nc 2
nop 0
crap 2
1
<?php
2
3
namespace AsyncPHP\Icicle\Database\Builder;
4
5
use AsyncPHP\Icicle\Database\Builder;
6
use AsyncPHP\Icicle\Database\Builder\Method\BuildMethod;
7
use AsyncPHP\Icicle\Database\Builder\Method\DeleteMethod;
8
use AsyncPHP\Icicle\Database\Builder\Method\InsertMethod;
9
use AsyncPHP\Icicle\Database\Builder\Method\LimitMethod;
10
use AsyncPHP\Icicle\Database\Builder\Method\OrderByMethod;
11
use AsyncPHP\Icicle\Database\Builder\Method\OrWhereMethod;
12
use AsyncPHP\Icicle\Database\Builder\Method\SelectMethod;
13
use AsyncPHP\Icicle\Database\Builder\Method\TableMethod;
14
use AsyncPHP\Icicle\Database\Builder\Method\UpdateMethod;
15
use AsyncPHP\Icicle\Database\Builder\Method\WhereMethod;
16
use AsyncPHP\Icicle\Database\Method\CloneWithMethod;
17
use Aura\SqlQuery\QueryFactory;
18
19
final class MySQLBuilder implements Builder
20
{
21
    use BuildMethod;
22
    use DeleteMethod;
23
    use InsertMethod;
24
    use LimitMethod;
25
    use OrderByMethod;
26
    use OrWhereMethod;
27
    use SelectMethod;
28
    use TableMethod;
29
    use UpdateMethod;
30
    use WhereMethod;
31
    use CloneWithMethod;
32
33
    /**
34
     * @var QueryFactory
35
     */
36
    protected $factory;
37
38
    /**
39
     * @var QueryInterface
40
     */
41
    protected $query;
42
43
    /**
44
     * @return QueryFactory
45
     */
46 1
    protected function factory()
47
    {
48 1
        if (!isset($this->factory)) {
49 1
            $this->factory = new QueryFactory("mysql");
50 1
        }
51
52 1
        return $this->factory;
53
    }
54
}
55