Completed
Push — 3.x ( e5eb1c...76cecd )
by Paul
9s
created

Delete::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 *
4
 * This file is part of Aura for PHP.
5
 *
6
 * @license http://opensource.org/licenses/bsd-license.php BSD
7
 *
8
 */
9
namespace Aura\SqlQuery\Sqlite;
10
11
use Aura\SqlQuery\Common;
12
13
/**
14
 *
15
 * An object for Sqlite DELETE queries.
16
 *
17
 * @package Aura.SqlQuery
18
 *
19
 */
20
class Delete extends Common\Delete implements Common\OrderByInterface, Common\LimitOffsetInterface
21
{
22
    use Common\LimitOffsetTrait;
23
24 2
    protected function build()
25
    {
26 2
        return parent::build()
27 2
            . $this->builder->buildLimitOffset($this->getLimit(), $this->offset);
0 ignored issues
show
Bug introduced by
The property builder does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
28
    }
29
30
    /**
31
     *
32
     * Adds a column order to the query.
33
     *
34
     * @param array $spec The columns and direction to order by.
35
     *
36
     * @return $this
37
     *
38
     */
39 1
    public function orderBy(array $spec)
40
    {
41 1
        return $this->addOrderBy($spec);
42
    }
43
}
44