Delete::getStatement()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
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 Delete extends Query
7
{
8
    use Clause\Where;
9
    use Clause\OrderBy;
10
    use Clause\Limit;
11
    use Clause\Returning;
12
13
    protected $table = '';
14
15 1
    public function from(string $table)
16
    {
17 1
        $this->table = $table;
18
19 1
        return $this;
20
    }
21
22 1
    public function getStatement(): string
23
    {
24
        return 'DELETE'
25 1
               . $this->flags->build()
26 1
               . ' FROM ' . $this->table
27 1
               . $this->where->build()
28 1
               . $this->returning->build();
29
    }
30
}
31