Code Duplication    Length = 5-7 lines in 2 locations

src/Container/src/Container.php 2 locations

@@ 209-215 (lines=7) @@
206
        }
207
208
        // Look up service in resolved instances first.
209
        if (isset($this->instances[$id])) {
210
            $object = $this->decorateObject($id, $this->instances[$id]);
211
            // Delete all decorator callbacks to avoid applying them once more on another get call.
212
            unset($this->decoratorDefinitions[$id]);
213
214
            return $object;
215
        }
216
217
        // Detect circular references.
218
        // We mark service as being resolved to detect circular references through out the resolution chain.
@@ 232-236 (lines=5) @@
229
            $object = $this->decorateObject($id, $object);
230
231
            // Cache shared instances.
232
            if (isset($this->shared[$id])) {
233
                $this->instances[$id] = $object;
234
                // Remove all decorator callbacks to prevent further decorations on concrete instance.
235
                unset($this->decoratorDefinitions[$id]);
236
            }
237
238
            return $object;
239
        } catch (ArgumentResolverException $resolveException) {