@@ 69-79 (lines=11) @@ | ||
66 | /** |
|
67 | * @param int $index |
|
68 | */ |
|
69 | public function remove($index) |
|
70 | { |
|
71 | if (!array_key_exists($index, $this->items)) { |
|
72 | throw new OutOfRangeException(sprintf( |
|
73 | 'Could not find an item with index %d', |
|
74 | $index |
|
75 | )); |
|
76 | } |
|
77 | ||
78 | array_splice($this->items, $index, 1); |
|
79 | } |
|
80 | ||
81 | /** |
|
82 | * @param int $index |
|
@@ 85-95 (lines=11) @@ | ||
82 | * @param int $index |
|
83 | * @return ObjectInterface |
|
84 | */ |
|
85 | public function get($index) |
|
86 | { |
|
87 | if (!array_key_exists($index, $this->items)) { |
|
88 | throw new OutOfRangeException(sprintf( |
|
89 | 'Could not find an item with index %d', |
|
90 | $index |
|
91 | )); |
|
92 | } |
|
93 | ||
94 | return $this->items[$index]; |
|
95 | } |
|
96 | ||
97 | /** |
|
98 | * {@inheritdoc} |