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.

ForeignKey::foreignKey()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 3
1
<?php
2
3
namespace Dami\Migration\Api;
4
5
use Rentgen\Database\Constraint\ForeignKey as RentgenForeignKey;
6
use Rentgen\Database\Table as RentgenTable;
7
use Rentgen\Database\Schema;
8
use Rentgen\Schema\Info;
9
10
class ForeignKey extends RentgenForeignKey
11
{
12
    private $info;
13
14
    public function __construct(Info $info)
15
    {
16
        $this->info = $info;
17
    }
18
19 View Code Duplication
    public function foreignKey($tableName, $columnNames, array $options = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
    {
21
        $schema = isset($options['schema']) ? new Schema($options['schema']) : null;
22
        $table = new RentgenTable($tableName, $schema);
23
24
        $this->setTable($table);
25
        $this->setColumns($columnNames);
26
27
        return $this;
28
    }
29
30 View Code Duplication
    public function reference($tableName, $columnNames, array $options = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
31
    {
32
        $schema = isset($options['schema']) ? new Schema($options['schema']) : null;
33
        $table = new RentgenTable($tableName, $schema);
34
35
        $this->setReferencedTable($table);
0 ignored issues
show
Bug introduced by
The method setReferencedTable() does not exist on Dami\Migration\Api\ForeignKey. Did you maybe mean reference()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
36
        $this->setReferencedColumns($columnNames);
37
38
        return $this;
39
    }
40
}
41