From f6b428c3c1fc0e0880750a9689ff8f0d26e08bbb Mon Sep 17 00:00:00 2001 From: Claude LE BRIS Date: Wed, 25 Feb 2026 11:31:45 +0100 Subject: [PATCH] Fixes php 8.5 deprecated methods SplObjectStorage::attach() and SplObjectStorage::detach() --- src/Pimple/Container.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Pimple/Container.php b/src/Pimple/Container.php index 23e851b..3bbd255 100644 --- a/src/Pimple/Container.php +++ b/src/Pimple/Container.php @@ -196,7 +196,7 @@ public function protect($callable) throw new ExpectedInvokableException('Callable is not a Closure or invokable object.'); } - $this->protected->attach($callable); + $this->protected->offsetSet($callable); return $callable; } @@ -268,8 +268,8 @@ public function extend($id, $callable) }; if (isset($this->factories[$factory])) { - $this->factories->detach($factory); - $this->factories->attach($extended); + $this->factories->offsetUnset($factory); + $this->factories->offsetSet($extended); } return $this[$id] = $extended;