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

AbstractClassFromArray   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 7
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 3
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