| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Mbh\Collection\Traits\Sequenceable\Arrayed; |
||
| 49 | public static function fromItems(Traversable $array) |
||
| 50 | { |
||
| 51 | if (!$array instanceof CountableInterface) { |
||
| 52 | return static::fromArray(iterator_to_array($array)); |
||
| 53 | } |
||
| 54 | |||
| 55 | $sfa = new SplFixedArray(count($array)); |
||
| 56 | |||
| 57 | foreach ($array as $i => $elem) { |
||
| 58 | $sfa[$i] = $elem; |
||
| 59 | } |
||
| 60 | |||
| 61 | return new static($sfa); |
||
| 62 | } |
||
| 66 |