GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

RenameTableCommand::getSql()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6667
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
namespace Rentgen\Schema\Manipulation;
3
4
use Rentgen\Schema\Command;
5
use Rentgen\Database\Table;
6
7
class RenameTableCommand extends Command
8
{
9
    private $table;
10
    private $newTableName;
11
12
    /**
13
     * Sets a table.
14
     *
15
     * @param Table $table The table instance.
16
     *
17
     * @return RenameTableCommand
18
     */
19
    public function setTable(Table $table)
20
    {
21
        $this->table = $table;
22
23
        return $this;
24
    }
25
26
    /**
27
     * Sets a table name.
28
     *
29
     * @param string $newTableName New table name.
30
     *
31
     * @return RenameTableCommand
32
     */
33
    public function setNewName($newTableName)
34
    {
35
        $this->newTableName = $newTableName;
36
37
        return $this;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getSql()
44
    {
45
        $sql = sprintf('ALTER TABLE %s RENAME TO %s;'
46
            , $this->table->getQualifiedName()
47
            , $this->newTableName
48
        );
49
50
        return $sql;
51
    }
52
}
53