TruncateQuery   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
dl 0
loc 29
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toSql() 0 4 1
A getBindings() 0 4 1
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