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