Completed
Push — master ( 91fdab...75a7b9 )
by
unknown
13:37
created

Kunstmaan/AdminListBundle/AdminList/FieldAlias.php (2 issues)

Upgrade to new PHP Analysis Engine

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
     * @param $abbr string
13
     * @param $relation string
14
     */
15
    public function __construct($abbr, $relation)
16
    {
17
        $this->abbr = $abbr;
0 ignored issues
show
The property abbr 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...
18
        $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...
19
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    public function getAbbr()
26
    {
27
        return $this->abbr;
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getRelation()
34
    {
35
        return $this->relation;
36
    }
37
38
}
39