Skip to content

Commit

Permalink
Use properties over array keys
Browse files Browse the repository at this point in the history
Using array access is deprecated.
  • Loading branch information
greg0ire committed Nov 23, 2024
1 parent a42134c commit dd3604f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PersistentCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dd3604f

Please sign in to comment.