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