/home/techb158/dev.balacoffee.com/vendor/nette/utils/src/Utils
NameSizeModeActions
ArrayHash.php19050644editdlrm
ArrayList.php26740644editdlrm
Arrays.php114310644editdlrm
Callback.php35660644editdlrm
DateTime.php29230644editdlrm
exceptions.php7750644editdlrm
FileInfo.php12910644editdlrm
FileSystem.php92900644editdlrm
Finder.php133660644editdlrm
Floats.php21200644editdlrm
Helpers.php25600644editdlrm
Html.php194890644editdlrm
Image.php241970644editdlrm
ImageColor.php16410644editdlrm
ImageType.php4210644editdlrm
Json.php22740644editdlrm
ObjectHelpers.php70120644editdlrm
Paginator.php44890644editdlrm
Random.php10990644editdlrm
Reflection.php85720644editdlrm
ReflectionMethod.php8120644editdlrm
Strings.php221400644editdlrm
Type.php65080644editdlrm
Validators.php106640644editdlrm
Edit: /home/techb158/dev.balacoffee.com/vendor/nette/utils/src/Utils/ArrayList.php (2674B)
* @implements \ArrayAccess */ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate { use Nette\SmartObject; private array $list = []; /** * Transforms array to ArrayList. * @param list $array */ public static function from(array $array): static { if (!Arrays::isList($array)) { throw new Nette\InvalidArgumentException('Array is not valid list.'); } $obj = new static; $obj->list = $array; return $obj; } /** * Returns an iterator over all items. * @return \Iterator */ public function &getIterator(): \Iterator { foreach ($this->list as &$item) { yield $item; } } /** * Returns items count. */ public function count(): int { return count($this->list); } /** * Replaces or appends a item. * @param int|null $index * @param T $value * @throws Nette\OutOfRangeException */ public function offsetSet($index, $value): void { if ($index === null) { $this->list[] = $value; } elseif (!is_int($index) || $index < 0 || $index >= count($this->list)) { throw new Nette\OutOfRangeException('Offset invalid or out of range'); } else { $this->list[$index] = $value; } } /** * Returns a item. * @param int $index * @return T * @throws Nette\OutOfRangeException */ public function offsetGet($index): mixed { if (!is_int($index) || $index < 0 || $index >= count($this->list)) { throw new Nette\OutOfRangeException('Offset invalid or out of range'); } return $this->list[$index]; } /** * Determines whether a item exists. * @param int $index */ public function offsetExists($index): bool { return is_int($index) && $index >= 0 && $index < count($this->list); } /** * Removes the element at the specified position in this list. * @param int $index * @throws Nette\OutOfRangeException */ public function offsetUnset($index): void { if (!is_int($index) || $index < 0 || $index >= count($this->list)) { throw new Nette\OutOfRangeException('Offset invalid or out of range'); } array_splice($this->list, $index, 1); } /** * Prepends a item. * @param T $value */ public function prepend(mixed $value): void { $first = array_slice($this->list, 0, 1); $this->offsetSet(0, $value); array_splice($this->list, 1, 0, $first); } }