Update   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 10

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 10
dl 0
loc 27
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A table() 0 6 1
A getStatement() 0 9 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