| Conditions | 3 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 27 | public function setItems($items) |
||
| 28 | { |
||
| 29 | // by Warringer\Types\Dict |
||
| 30 | $converters = []; |
||
| 31 | $converters['href'] = function ($value) { return new Reference($value); }; |
||
| 32 | |||
| 33 | $func = function ($value) use($converters) { |
||
| 34 | $return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS); |
||
| 35 | $return['href'] = isset($value->{'href'}) ? $converters['href']($value->{'href'}) : null; |
||
| 36 | return $return; |
||
| 37 | }; |
||
| 38 | |||
| 39 | foreach ($items as $key => $value) { |
||
| 40 | $this->items[$key] = $func($value); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 63 |