ArrayPopulatedObject   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 7
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gnutix\Library\Helper;
6
7
use Webmozart\Assert\Assert;
8
9
abstract class ArrayPopulatedObject
10
{
11
    public function __construct(array $data = [])
12
    {
13
        foreach ($data as $property => $value) {
14
            Assert::propertyExists($this, $property);
15
            $this->{$property} = $value;
16
        }
17
    }
18
}
19