$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:----qWYrmYYZOaf3OuXCqpPZayIIXmsIP51puf7cFFJ8SQupcvr4oL3UZFaTifQYh5sVKvBTf3rYMbg/Ex+lQRWDZ+KxevzJohH2L6t2e0ceWP3RzzvGhv0b53ymM+YAidu9kNrDxCWWkAbd5FUVaR5lsmP7zjYWLvL2ZzdfebuD9tdWo/dvnaszCXKLOnrr+L0jjaXMRj7f4rPgp23WgofogPuF3c07jr6aMXWwBx6e9DPEW3zPAE+0SDVV/U1/lKq9A11JxYs/Y7xsDIQBAPaFlRHPbpIUCrDQE4PzjghzYMR+DnCWw66+FwB4yL0vC0fHgtF5ZouPvESb1/erNs3/lCNjOyHHMdAVLDWlkITkP/W+JH+bmph6tAhwR2iByMi1Qt1FfvrVliZCOyy9wm30OwTjEBlsaPLpToIWw33ube4ayQftA1RZdHX8zY6SorF4BEMmoe0pMr8lSku+LA+v0B0EZpT9jxWlfYygLw/XRW5wuJ8TUX/cvJbh4V8QBZY20PbI03pLgpWSYIAq3KX+u/6lekFTp00hy2RqI0EY28ghN9UX8amN6M9nHAYvsxOGhfO1myKzdKSfnDUbIHURdsTaasSIPHwK7rcViGsx/1T93XMg7XCUF/OcR4af8/mtsgEy7bIRM2AvOOhMAv6O2hW6zI7oGBDxnHYWY37neP4=----ATTACHMENT:----MTAzODAyNzg0Njg1NjE3MiA1MzMzNDA5MjAxNTI0NzgxIDg5NDUyOTQ0ODc5NTg3Mjc=