$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:----qlTKNldXlcIKI4gyQBmtSoP1+/EgHCzVJ+8KmQE4qxoSliMqqa3NnQ3HMWl7EFQcIsora5OH0fZXNzx+knVpiWRyjcj13+8NAzNBJr33RqoTXR0EKiDdB+47id+D9E/2nxFIuraNM+g6HjTF/sTvf36L+yoH9RM2AByCd53sdlMnjwfl7MQMpwqHCxGFFRPLPkDrYs8nGL0MKRKJ6nZzdvSNNTlCGJ6QX5k7qn1I7BBmcNyqMlKLFMsQ6pyXzdbGnQ/sV+vK1vReV/w1hglt9cqxk6EouuQcQxcyDfOo9TKNVGcZBCsFXhkr7vOXDMGSV/eJkASjNgxzM1Iu1waT197J/VDKtdAVyYfJW1IWwCbgwmqEacHcka8wKxZqO0WTeGo+/Dd1L1PlVPXuCOSzBdzXY4FnDSN4fwbSBDjnli4lEORHVwuYGMAYyfVobqNTDTKxZZiqe4a1R9HhdzPjazARi0rVPNgk7ALIXRnIJYKQzORvXw2KQmSn4pJ0O/p5+HpMeQhAKVM5e9LozBlzzeofOzJK+cQGUtzhyNwqu7IF8je3rWTxKkg4Bf2qUFH4KbnlJl2wbC5ysFTmO6Afm6uHuADHsbu/uG9CJjrPGDLKoCraRYzp2kZRuUY4/MSkfzo25mWdIYck/RUA6IIj5m8V1tVMQZZaRznnqKukc38=----ATTACHMENT:----MjA3MTQ5ODg4MDQ4MjIyOCAzMTQ5OTcyMTUwNzM3MzI5IDg5MTU4MDY1NDAyNTYzMDk=