Conditions | 5 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 5.0144 |
Changes | 0 |
1 | <?php |
||
18 | 4 | public function __construct($mJobData = []) |
|
19 | { |
||
20 | 4 | if (is_array($mJobData) || is_object($mJobData)) |
|
21 | 4 | { |
|
22 | 4 | foreach ($mJobData as $_sKey => $_mValue) |
|
23 | { |
||
24 | 1 | if (property_exists($this, $_sKey)) |
|
25 | 1 | { |
|
26 | 1 | $this->{$_sKey} = $_mValue; |
|
27 | 1 | } |
|
28 | 4 | } |
|
29 | 4 | } |
|
30 | else |
||
31 | { |
||
32 | throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__)); |
||
33 | } |
||
34 | 4 | } |
|
35 | |||
49 | } |