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.

Constrant::getNameConstrant()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Classes\Db;
4
5
/**
6
 * constrants do banco de dados
7
 * -foreingkey
8
 * -primarykey
9
 * -unique
10
 *
11
 * @author Pedro Alarcao <[email protected]>
12
 * @link   https://github.com/pedro151/orm-generator
13
 */
14
class Constrant
15
{
16
    /**
17
     * constrants do banco de dados
18
     * -foreingkey
19
     * -primarykey
20
     * -unique
21
     *
22
     * @author Pedro Alarcao <[email protected]>
23
     */
24
    final private function __construct ()
25
    {
26
    }
27
28
    public static function getInstance ()
29
    {
30
        return new self();
31
    }
32
33
    /**
34
     * @var string
35
     */
36
    protected $constrant;
37
38
    /**
39
     * @var string
40
     */
41
    protected $schema;
42
43
    /**
44
     * @var string
45
     */
46
    protected $table;
47
48
    /**
49
     * @var string
50
     */
51
    protected $column;
52
53
    /**
54
     * @param $array
55
     *
56
     * @return Constrant
57
     */
58
    public function populate ( $array )
59
    {
60
        if ( isset( $array[ 'schema' ] ) )
61
        {
62
            $this->schema = $array[ 'schema' ];
63
        }
64
65
        $this->database = $array[ 'database' ];
0 ignored issues
show
Bug introduced by
The property database does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
66
        $this->constrant = $array[ 'constrant' ];
67
        $this->table = $array[ 'table' ];
68
        $this->column = $array[ 'column' ];
69
70
        return $this;
71
    }
72
73
    public function getDatabase (){
74
        return $this->database;
75
    }
76
77
    /**
78
     * @return string
79
     */
80
    public function getNameConstrant ()
81
    {
82
        return $this->constrant;
83
    }
84
85
    public function hasSchema ()
86
    {
87
        return (bool) $this->schema;
88
    }
89
90
    /**
91
     * @return string
92
     */
93
    public function getSchema ()
94
    {
95
        return $this->schema;
96
    }
97
98
    /**
99
     * @return string
100
     */
101
    public function getTable ()
102
    {
103
        return $this->table;
104
    }
105
106
    /**
107
     * @return string
108
     */
109
    public function getColumn ()
110
    {
111
        return $this->column;
112
    }
113
114
}
115