Total Complexity | 6 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php namespace Mbh\Collection\Traits\Sequenceable\Arrayed; |
||
15 | trait Builder |
||
16 | { |
||
17 | protected $sfa = null; |
||
18 | |||
19 | /** |
||
20 | * Create an fixed array |
||
21 | * |
||
22 | * @param Traversable $array data |
||
23 | */ |
||
24 | protected function __construct(Traversable $array) |
||
25 | { |
||
26 | $this->sfa = $array; |
||
27 | $this->checkCapacity(); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @inheritDoc |
||
32 | */ |
||
33 | public static function empty() |
||
34 | { |
||
35 | return new static(new SplFixedArray(0)); |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @inheritDoc |
||
40 | */ |
||
41 | public static function fromArray(array $array) |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @inheritDoc |
||
48 | */ |
||
49 | public static function fromItems(Traversable $array) |
||
62 | } |
||
63 | |||
64 | abstract protected function checkCapacity(); |
||
65 | } |
||
66 |