diff --git a/src/ItemPipeline/Item.php b/src/ItemPipeline/Item.php index c440054..f8d6a05 100644 --- a/src/ItemPipeline/Item.php +++ b/src/ItemPipeline/Item.php @@ -58,8 +58,12 @@ public function offsetGet(mixed $offset): mixed public function offsetSet(mixed $offset, mixed $value): void { - /** @psalm-suppress PossiblyNullArrayOffset */ - /** @phpstan-ignore offsetAccess.invalidOffset */ + if ($offset === null) { + $this->data[] = $value; + + return; + } + $this->data[$offset] = $value; }