BaseObject::__construct()   A
last analyzed

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
cc 3
eloc 3
c 1
b 0
f 0
nc 3
nop 1
dl 0
loc 5
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace kosuha606\HtmlUniParser;
5
6
/**
7
 * Configurable class
8
 * @package app\Parsers
9
 */
10
abstract class BaseObject
11
{
12
    /**
13
     * @param $config
14
     */
15
    public function __construct($config = [])
16
    {
17
        foreach ($config as $key => $value) {
18
            if (\property_exists($this, $key)) {
19
                $this->$key = $value;
20
            }
21
        }
22
    }
23
}
24