| Conditions | 5 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 5.675 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 1 | public function setAll($items) |
|
| 21 | { |
||
| 22 | 1 | if (!is_array($items) && !$items instanceof \Traversable) { |
|
| 23 | throw new \InvalidArgumentException('Parameter must be an array or an instance of Traversable'); |
||
| 24 | } |
||
| 25 | |||
| 26 | 1 | foreach ($items as $key => $item) { |
|
| 27 | 1 | if (is_array($item)) { |
|
| 28 | $item = new static($item); |
||
| 29 | } |
||
| 30 | 1 | $this->set($key, $item); |
|
| 31 | 1 | } |
|
| 32 | |||
| 33 | 1 | return $this; |
|
| 34 | } |
||
| 35 | |||
| 46 |