Update::getStatement()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Sirius\Sql;
5
6
class Update extends Query
7
{
8
    use Clause\UpdateColumns;
9
    use Clause\Where;
10
    use Clause\OrderBy;
11
    use Clause\Limit;
12
    use Clause\Returning;
13
14
    protected $table;
15
16 1
    public function table(string $table)
17
    {
18 1
        $this->table = $table;
19
20 1
        return $this;
21
    }
22
23 1
    public function getStatement(): string
24
    {
25
        return 'UPDATE'
26 1
               . $this->flags->build()
27 1
               . ' ' . $this->table
28 1
               . $this->columns->build()
29 1
               . $this->where->build()
30 1
               . $this->returning->build();
31
    }
32
}
33