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