Passed
Push — main ( 826114...756b63 )
by Peter
02:30
created

QueryBuilder   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 34
ccs 8
cts 8
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A delete() 0 3 1
A insert() 0 3 1
A select() 0 3 1
A update() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace QB\MySQL\QueryBuilder;
6
7
use QB\Generic\Clause\IColumn;
8
use QB\Generic\Clause\Table;
9
use QB\Generic\QueryBuilder\QueryBuilder as GenericQueryBuilder;
10
use QB\MySQL\Statement\Delete;
11
use QB\MySQL\Statement\Insert;
12
use QB\MySQL\Statement\Select;
13
use QB\MySQL\Statement\Update;
14
15
class QueryBuilder extends GenericQueryBuilder
16
{
17
    /**
18
     * @return Select
19
     */
20 1
    public function select(IColumn|string ...$columns): Select
21
    {
22 1
        return new Select(...$columns);
23
    }
24
25
    /**
26
     * @return Insert
27
     */
28 1
    public function insert(): Insert
29
    {
30 1
        return new Insert();
31
    }
32
33
    /**
34
     * @param Table|string ...$tables
35
     *
36
     * @return Update
37
     */
38 1
    public function update(Table|string ...$tables): Update
39
    {
40 1
        return new Update(...$tables);
41
    }
42
43
    /**
44
     * @return Delete
45
     */
46 1
    public function delete(): Delete
47
    {
48 1
        return new Delete();
49
    }
50
}
51