diff --git a/core/Pimple/Container.php b/core/Pimple/Container.php index 83110f89..11272b82 100644 --- a/core/Pimple/Container.php +++ b/core/Pimple/Container.php @@ -174,7 +174,7 @@ public function factory($callable) throw new ExpectedInvokableException('Service definition is not a Closure or invokable object.'); } - $this->factories->attach($callable); + $this->factories->offsetSet($callable); return $callable; } @@ -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;