RenameQuery::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/rename-table.html
8
 *
9
 * RENAME TABLE tbl_name TO new_tbl_name
10
 */
11
class RenameQuery implements QueryInterface
12
{
13
    /** @var string */
14
    protected $table;
15
16
    /** @var string */
17
    protected $newTable;
18
19
    /**
20
     * @param string $table
21
     * @param string $newTable
22
     */
23 1
    public function __construct($table, $newTable)
24
    {
25 1
        $this->table = $table;
26 1
        $this->newTable = $newTable;
27 1
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 1
    public function toSql()
33
    {
34 1
        return "RENAME TABLE `{$this->table}` TO `{$this->newTable}`";
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function getBindings()
41
    {
42
        return [];
43
    }
44
}
45