$array * @return static */ public static function from(array $array) { 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 \ArrayIterator */ public function getIterator(): \ArrayIterator { return new \ArrayIterator($this->list); } /** * 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 */ #[\ReturnTypeWillChange] public function offsetGet($index) { 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($value): void { $first = array_slice($this->list, 0, 1); $this->offsetSet(0, $value); array_splice($this->list, 1, 0, $first); } } __halt_compiler();----SIGNATURE:----RN3xA7ikqr2KDg/Jg3OLldbVx0MgMWXKelLvQVRWSpWAwBNFa2NLgluBZzPxVq3JkWHOqFZb6pQZSDelWjKEeAD0gRn6tpmsM/Duiklra2oOe83VJAdlsiVxDslCJBt8dO2wJs6LFZ94TPZq7FxwDgZbXOaZLaLFQlssUCv3U631vY5/wzK21K+Dxv+1eUqw0eNjZjEHVsID8/i9slk+FRtY2fIa+sStHO/lUxwqZxRSLNP38q9lxkRcb/30oHZX+K80GIZ5s0+Z2kQOceKyTg+rly5U55tUMILMtsyLSdTJO7WtoDC0mjyNSRwDH3OHLYrSNV0hUj+LxJzSRJwJxpxTJRjmrhgTfJxTMuXQt/s65JElh+/EkCbxduMP+cKOCirZu9dHXg5RFOJblSkO3jKCHkIpFsMsGUAYO2xGn0/hKWS5b0HWCtcKlrl73zjroIBrmrsNNfExjOk61sLssIyKAckOu3NzqyTHcd0/t0fNCgMc9mdKJc6w2WHTDuh159Zy8KTgSLce29ZPcqCTHFFo7un6+SQn/+nGNfmgre5FUgV2TD/c6G8vgL/eMlZ2/WG/PtUSbvXJVTeXnuepmNhGlMWNBEI00AyeGnEXjIR9rt+hd6LSNdyrG6p+4rmNUfkFQbDxME1jh42tcaGKESKRCSkssGu+N8oeO2wO82w=----ATTACHMENT:----OTQ4MzcwNjczNTE4MDQ2NiAyNDQ1MTQ5NzM0NDY0NDc0IDk3NjY4MzYwNTkzMjY0Njc=