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   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 5
c 2
b 1
f 1
lcom 1
cbo 1
dl 0
loc 48
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
A getName() 0 4 1
A getColumns() 0 4 1
A getTable() 0 4 1
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