Passed
Push — master ( eece30...2edd63 )
by Radu
02:12
created

AbstractClassFromArray::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 3
nc 3
nop 1
1
<?php
2
namespace WebServCo\Framework;
3
4
abstract class AbstractClassFromArray
5
{
6
    public function __construct($data)
7
    {
8
        foreach (get_object_vars($this) as $property => $default) {
9
            if (array_key_exists($property, $data)) {
10
                $this->{$property} = $data[$property];
11
            }
12
        }
13
    }
14
}
15