From dd3604f523cc35283f0c4f4c36329b322845e57e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 23 Nov 2024 21:06:56 +0100 Subject: [PATCH] Use properties over array keys Using array access is deprecated. --- src/PersistentCollection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PersistentCollection.php b/src/PersistentCollection.php index ef5f28c3cb3..876a92a261a 100644 --- a/src/PersistentCollection.php +++ b/src/PersistentCollection.php @@ -509,7 +509,7 @@ public function __wakeup(): void */ public function first() { - if (! $this->initialized && ! $this->isDirty && $this->getMapping()['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY) { + if (! $this->initialized && ! $this->isDirty && $this->getMapping()->fetch === ClassMetadata::FETCH_EXTRA_LAZY) { $persister = $this->getUnitOfWork()->getCollectionPersister($this->getMapping()); return array_values($persister->slice($this, 0, 1))[0] ?? false;