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.

Index::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Rentgen\Database;
4
5
class Index implements DatabaseObjectInterface
6
{
7
    private $columns = array();
8
    private $table;
9
10
    /**
11
     * Constructor.
12
     *
13
     * @param array|string $columns Columns of index.
14
     * @param Table        $table   Table instance.
15
     */
16
    public function __construct($columns, Table $table)
17
    {
18
        $this->columns = is_string($columns) ? array($columns) : $columns;
19
        $this->table = $table;
20
    }
21
22
    /**
23
     * Get index name.
24
     *
25
     * @return string Index name.
26
     */
27
    public function getName()
28
    {
29
        return $this->table->getName() . '_' .  implode('_', $this->columns) . '_idx';
30
    }
31
32
    /**
33
     * Get column names of index.
34
     *
35
     * @return string[] Array of Column instances.
36
     */
37
    public function getColumns()
38
    {
39
        return $this->columns;
40
    }
41
42
    /**
43
     * Get table instance.
44
     *
45
     * @return Table Table instance.
46
     */
47
    public function getTable()
48
    {
49
        return $this->table;
50
    }
51
52
}
53