These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Kunstmaan\AdminListBundle\AdminList; |
||
4 | |||
5 | /** |
||
6 | * FieldAlias |
||
7 | */ |
||
8 | class FieldAlias |
||
9 | { |
||
10 | /** |
||
11 | * FieldAlias constructor. |
||
12 | * |
||
13 | * @param $abbr string |
||
14 | * @param $relation string |
||
15 | */ |
||
16 | 8 | public function __construct($abbr, $relation) |
|
17 | { |
||
18 | 8 | $this->abbr = $abbr; |
|
0 ignored issues
–
show
|
|||
19 | 8 | $this->relation = $relation; |
|
0 ignored issues
–
show
The property
relation 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...
|
|||
20 | 8 | } |
|
21 | |||
22 | /** |
||
23 | * @return string |
||
24 | */ |
||
25 | 2 | public function getAbbr() |
|
26 | { |
||
27 | 2 | return $this->abbr; |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * @return string |
||
32 | */ |
||
33 | 2 | public function getRelation() |
|
34 | { |
||
35 | 2 | return $this->relation; |
|
36 | } |
||
37 | } |
||
38 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: