| @@ -173,9 +173,9 @@ | ||
| 173 | 173 | if (!\is_object($callable) || !\method_exists($callable, '__invoke')) { |
| 174 | 174 | throw new ExpectedInvokableException('Service definition is not a Closure or invokable object.'); |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - $this->factories->attach($callable); | |
| 177 | + $this->factories->offsetSet($callable); | |
| 178 | 178 | |
| 179 | 179 | return $callable; |
| 180 | 180 | } |
| 181 | 181 | |
| @@ -195,9 +195,9 @@ | ||
| 195 | 195 | if (!\is_object($callable) || !\method_exists($callable, '__invoke')) { |
| 196 | 196 | throw new ExpectedInvokableException('Callable is not a Closure or invokable object.'); |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - $this->protected->attach($callable); | |
| 199 | + $this->protected->offsetSet($callable); | |
| 200 | 200 | |
| 201 | 201 | return $callable; |
| 202 | 202 | } |
| 203 | 203 | |
| @@ -267,10 +267,10 @@ | ||
| 267 | 267 | return $callable($factory($c), $c); |
| 268 | 268 | }; |
| 269 | 269 | |
| 270 | 270 | if (isset($this->factories[$factory])) { |
| 271 | - $this->factories->detach($factory); | |
| 272 | - $this->factories->attach($extended); | |
| 271 | + $this->factories->offsetUnset($factory); | |
| 272 | + $this->factories->offsetSet($extended); | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | return $this[$id] = $extended; |
| 276 | 276 | } |