Skip to content

Commit

Permalink
Merge pull request #11726 from greg0ire/use-properties-minor
Browse files Browse the repository at this point in the history
Use properties over array keys
  • Loading branch information
greg0ire authored Nov 23, 2024
2 parents a42134c + dd3604f commit d7f13a8
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 d7f13a8

Please sign in to comment.