Skip to content

Commit c57bd1a

Browse files
committed
Fix SplObjectStorage->(contains|attach|detach) deprecation
1 parent 52e6155 commit c57bd1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/DI/Resolver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ public function getContainerBuilder(): ContainerBuilder
7474

7575
public function resolveDefinition(Definition $def): void
7676
{
77-
if ($this->recursive->contains($def)) {
77+
if ($this->recursive->offsetExists($def)) {
7878
$names = array_map(fn($item) => $item->getName(), iterator_to_array($this->recursive));
7979
throw new ServiceCreationException(sprintf('Circular reference detected for services: %s.', implode(', ', $names)));
8080
}
8181

8282
try {
83-
$this->recursive->attach($def);
83+
$this->recursive->offsetSet($def);
8484

8585
$def->resolveType($this);
8686
if (!$def->getType()) {
@@ -90,7 +90,7 @@ public function resolveDefinition(Definition $def): void
9090
throw $this->completeException($e, $def);
9191

9292
} finally {
93-
$this->recursive->detach($def);
93+
$this->recursive->offsetUnset($def);
9494
}
9595
}
9696

0 commit comments

Comments
 (0)