| @@ 2992-2999 (lines=8) @@ | ||
| 2989 | * @return static |
|
| 2990 | * <p>(Immutable)</p> |
|
| 2991 | */ |
|
| 2992 | public function removeFirst(): self |
|
| 2993 | { |
|
| 2994 | $tmpArray = $this->getArray(); |
|
| 2995 | ||
| 2996 | \array_shift($tmpArray); |
|
| 2997 | ||
| 2998 | return static::create($tmpArray, $this->iteratorClass, false); |
|
| 2999 | } |
|
| 3000 | ||
| 3001 | /** |
|
| 3002 | * Remove the last value from the current array. |
|
| @@ 3007-3014 (lines=8) @@ | ||
| 3004 | * @return static |
|
| 3005 | * <p>(Immutable)</p> |
|
| 3006 | */ |
|
| 3007 | public function removeLast(): self |
|
| 3008 | { |
|
| 3009 | $tmpArray = $this->getArray(); |
|
| 3010 | ||
| 3011 | \array_pop($tmpArray); |
|
| 3012 | ||
| 3013 | return static::create($tmpArray, $this->iteratorClass, false); |
|
| 3014 | } |
|
| 3015 | ||
| 3016 | /** |
|
| 3017 | * Removes a particular value from an array (numeric or associative). |
|
| @@ 3184-3193 (lines=10) @@ | ||
| 3181 | * @return static |
|
| 3182 | * <p>(Immutable)</p> |
|
| 3183 | */ |
|
| 3184 | public function rest(int $from = 1): self |
|
| 3185 | { |
|
| 3186 | $tmpArray = $this->getArray(); |
|
| 3187 | ||
| 3188 | return static::create( |
|
| 3189 | \array_splice($tmpArray, $from), |
|
| 3190 | $this->iteratorClass, |
|
| 3191 | false |
|
| 3192 | ); |
|
| 3193 | } |
|
| 3194 | ||
| 3195 | /** |
|
| 3196 | * Return the array in the reverse order. |
|