Lines Matching refs:elements
33 private array $elements;
38 * @param array<int|string, mixed> $elements
40 * @phpstan-param array<int, T> $elements
42 public function __construct(array $elements = [])
44 $this->elements = $elements;
54 return \reset($this->elements);
64 return \end($this->elements);
77 return new \ArrayIterator($this->elements);
81 * Count elements of an object
87 return \count($this->elements);
99 return \array_key_exists($offset, $this->elements);
114 return $this->elements[$offset] ?? null;
129 $this->elements[] = $value;
131 $this->elements[$offset] = $value;
145 if (! \array_key_exists($offset, $this->elements)) {
149 unset($this->elements[$offset]);
161 return \array_slice($this->elements, $offset, $length, true);
171 return $this->elements;