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

MySQLBuilder::factory()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

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 8
ccs 0
cts 7
cp 0
rs 9.4286
cc 2
eloc 4
nc 2
nop 0
crap 6
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\CloneWithMethod;
8
use AsyncPHP\Icicle\Database\Builder\Method\DeleteMethod;
9
use AsyncPHP\Icicle\Database\Builder\Method\InsertMethod;
10
use AsyncPHP\Icicle\Database\Builder\Method\LimitMethod;
11
use AsyncPHP\Icicle\Database\Builder\Method\OrderByMethod;
12
use AsyncPHP\Icicle\Database\Builder\Method\OrWhereMethod;
13
use AsyncPHP\Icicle\Database\Builder\Method\SelectMethod;
14
use AsyncPHP\Icicle\Database\Builder\Method\TableMethod;
15
use AsyncPHP\Icicle\Database\Builder\Method\UpdateMethod;
16
use AsyncPHP\Icicle\Database\Builder\Method\WhereMethod;
17
use Aura\SqlQuery\QueryFactory;
18
19
final class MySQLBuilder implements Builder
20
{
21
    use BuildMethod;
22
    use CloneWithMethod;
23
    use DeleteMethod;
24
    use InsertMethod;
25
    use LimitMethod;
26
    use OrderByMethod;
27
    use OrWhereMethod;
28
    use SelectMethod;
29
    use TableMethod;
30
    use UpdateMethod;
31
    use WhereMethod;
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
    protected function factory()
47
    {
48
        if (!isset($this->factory)) {
49
            $this->factory = new QueryFactory("mysql");
50
        }
51
52
        return $this->factory;
53
    }
54
}
55