Completed
Pull Request — master (#159)
by Kevin
02:41
created

ComponentClass::getHierarchy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Magium\Introspection;
4
5
class ComponentClass
6
{
7
8
    protected $class;
9
    protected $baseType;
10
    protected $functionalType;
11
    protected $hierarchy;
12
13
    public function __construct($class, $baseType, $functionalType, array $hierarchy)
14
    {
15
        $this->class = $class;
16
        $this->baseType = $baseType;
17
        $this->functionalType = $functionalType;
18
        $this->heirarchy = $hierarchy;
0 ignored issues
show
Bug introduced by
The property heirarchy 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
     * @return mixed
23
     */
24
    public function getClass()
25
    {
26
        return $this->class;
27
    }
28
29
    /**
30
     * @return mixed
31
     */
32
    public function getBaseType()
33
    {
34
        return $this->baseType;
35
    }
36
37
    /**
38
     * @return mixed
39
     */
40
    public function getFunctionalType()
41
    {
42
        return $this->functionalType;
43
    }
44
45
    /**
46
     * @return array
47
     */
48
    public function getHierarchy()
49
    {
50
        return $this->hierarchy;
51
    }
52
53
54
}
55