@@ 84-95 (lines=12) @@ | ||
81 | * @param mixed $element |
|
82 | * @return bool |
|
83 | */ |
|
84 | public function remove($element): bool |
|
85 | { |
|
86 | $index = array_search($element, $this->elements, true); |
|
87 | ||
88 | if (false === $index) { |
|
89 | return false; |
|
90 | } |
|
91 | ||
92 | array_splice($this->elements, $index, 1); |
|
93 | ||
94 | return true; |
|
95 | } |
|
96 | ||
97 | /** |
|
98 | * Returns an array of all elements in the collection |
@@ 82-93 (lines=12) @@ | ||
79 | * @param mixed $element |
|
80 | * @return bool |
|
81 | */ |
|
82 | public function remove($element): bool |
|
83 | { |
|
84 | $index = array_search($element, $this->elements, true); |
|
85 | ||
86 | if (false === $index) { |
|
87 | return false; |
|
88 | } |
|
89 | ||
90 | array_splice($this->elements, $index, 1); |
|
91 | ||
92 | return true; |
|
93 | } |
|
94 | ||
95 | /** |
|
96 | * Returns an array of all elements in the collection |