Skip to content

Commit 70c7bb3

Browse files
committed
fix : Fix logic error in splice() method
1 parent 23eff1f commit 70c7bb3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/kim/present/lib/arrayutils/ArrayUtils.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,6 @@
197197
* @method static ArrayUtils sortKeyFrom(iterable $from, ?callable $callback = null)
198198
* @method static array sortKeyFromAs(iterable $from, ?callable $callback = null)
199199
*
200-
* @method ArrayUtils splice(int $offset, ?int $length = null, mixed ...$replacement)
201-
* @method array spliceAs(int $offset, ?int $length = null, mixed ...$replacement)
202-
* @method static ArrayUtils spliceFrom(iterable $from, int $offset, ?int $length = null, mixed ...$replacement)
203-
* @method static array spliceFromAs(iterable $from, int $offset, ?int $length = null, mixed ...$replacement)
204-
*
205200
* @method ArrayUtils unique(int $sortFlags = SORT_STRING)
206201
* @method array uniqueAs(int $sortFlags = SORT_STRING)
207202
* @method static ArrayUtils uniqueFrom(iterable $from, int $sortFlags = SORT_STRING)
@@ -274,6 +269,9 @@
274269
* @method mixed shift()
275270
* @method static mixed shiftFrom(iterable &$from)
276271
*
272+
* @method array splice(int $offset, ?int $length = null, mixed ...$replacement)
273+
* @method static array spliceFrom(iterable $from, int $offset, ?int $length = null, mixed ...$replacement)
274+
*
277275
* @method string join(string $glue = ",", string $prefix = "", string $suffix = "")
278276
* @method static string joinFrom(iterable $from, string $glue = ",", string $prefix = "", string $suffix = "")
279277
*/
@@ -934,8 +932,8 @@ protected static function __sortKey(array $from, ?callable $callback = null) : a
934932
* @see \array_splice
935933
* @url https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice
936934
*/
937-
protected static function __splice(array $from, int $offset, ?int $length = null, ...$replacement) : array{
938-
return array_splice($array, $offset, $length ?? count($from), $replacement);
935+
protected static function _splice(array &$from, int $offset, ?int $length = null, ...$replacement) : array{
936+
return array_splice($from, $offset, $length ?? count($from), $replacement);
939937
}
940938

941939
/**

0 commit comments

Comments
 (0)