repository = $repository; $this->data = $data; } public function offsetExists($offset): bool { return isset($this->data[$offset]); } #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->data[$offset]; } public function offsetSet($offset, $value): void { // Immutable // TODO check this out //return $this->offsetGet($offset); } public function offsetUnset($offset): void { // Immutable } public function count(): int { return count($this->data); } }