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

ComponentClass   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 50
c 0
b 0
f 0
wmc 5
lcom 0
cbo 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getClass() 0 4 1
A getBaseType() 0 4 1
A getFunctionalType() 0 4 1
A getHierarchy() 0 4 1
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