TruncateQuery::getBindings()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Wandu\Database\Query;
3
4
use Wandu\Database\Contracts\QueryInterface;
5
6
/**
7
 * @see http://dev.mysql.com/doc/refman/5.7/en/truncate-table.html
8
 *
9
 * TRUNCATE TABLE tbl_name
10
 */
11
class TruncateQuery implements QueryInterface
12
{
13
    /** @var string */
14
    protected $table;
15
16
    /**
17
     * @param string $table
18
     */
19 1
    public function __construct($table)
20
    {
21 1
        $this->table = $table;
22 1
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27 1
    public function toSql()
28
    {
29 1
        return "TRUNCATE TABLE `{$this->table}`";
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function getBindings()
36
    {
37
        return [];
38
    }
39
}
40