Type   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A loadResult() 0 6 2
1
<?php
2
3
namespace Chrl\AppBundle\Type;
4
5
abstract class Type implements TypeInterface
6
{
7
8
    /**
9
     * @param \stdClass $obj
10
     */
11
    public function __construct(\stdClass $obj = null)
12
    {
13
        if ($obj instanceof \stdClass) {
14
            $this->loadResult($obj);
15
        }
16
    }
17
18
    /**
19
     * @param \stdClass $obj
20
     */
21
    public function loadResult(\stdClass $obj)
22
    {
23
        foreach ($obj as $key => $value) {
0 ignored issues
show
Bug introduced by
The expression $obj of type object<stdClass> is not traversable.
Loading history...
24
            $this->$key = $value;
25
        }
26
    }
27
}
28