Conditions | 5 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 12 |
Ratio | 100 % |
Tests | 6 |
CRAP Score | 5.0729 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 2 | View Code Duplication | public function __construct($jobData = []) |
18 | { |
||
19 | 2 | if (is_array($jobData) || is_object($jobData)) { |
|
20 | 2 | foreach ($jobData as $key => $value) { |
|
21 | 2 | if (property_exists($this, $key)) { |
|
22 | 2 | $this->{$key} = $value; |
|
23 | } |
||
24 | } |
||
25 | } else { |
||
26 | throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__)); |
||
27 | } |
||
28 | 2 | } |
|
29 | |||
45 |