| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Mbh\Collection\Traits\Sequenceable; |
||
| 40 | public static function fromItems(Traversable $array) |
||
| 41 | { |
||
| 42 | if (!$array instanceof Countable) { |
||
| 43 | return static::fromArray(iterator_to_array($array)); |
||
| 44 | } |
||
| 45 | |||
| 46 | $sfa = new SplFixedArray(count($array)); |
||
|
|
|||
| 47 | |||
| 48 | foreach ($array as $i => $elem) { |
||
| 49 | $sfa[$i] = $elem; |
||
| 50 | } |
||
| 51 | |||
| 52 | return new static($sfa); |
||
| 53 | } |
||
| 57 |