Code Duplication    Length = 3-7 lines in 3 locations

lib/Drupal/Component/DependencyInjection/Container.php 1 location

@@ 146-148 (lines=3) @@
143
    }
144
145
    // Re-use shared service instance if it exists.
146
    if (isset($this->services[$id]) || ($invalid_behavior === ContainerInterface::NULL_ON_INVALID_REFERENCE && array_key_exists($id, $this->services))) {
147
      return $this->services[$id];
148
    }
149
150
    if (isset($this->loading[$id])) {
151
      throw new ServiceCircularReferenceException($id, array_keys($this->loading));

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Container.php 1 location

@@ 241-247 (lines=7) @@
238
    public function has($id)
239
    {
240
        for ($i = 2;;) {
241
            if ('service_container' === $id
242
                || isset($this->aliases[$id])
243
                || isset($this->services[$id])
244
                || array_key_exists($id, $this->services)
245
            ) {
246
                return true;
247
            }
248
            if (--$i && $id !== $lcId = strtolower($id)) {
249
                $id = $lcId;
250
            } else {

src/DependencyInjection/Container.php 1 location

@@ 77-79 (lines=3) @@
74
   * {@inheritdoc}
75
   */
76
  public function get($name, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
77
    if (isset($this->services[$name]) || ($invalidBehavior === ContainerInterface::NULL_ON_INVALID_REFERENCE && array_key_exists($name, $this->services))) {
78
      return $this->services[$name];
79
    }
80
81
    if (isset($this->loading[$name])) {
82
      throw new RuntimeException(sprintf('Circular reference detected for service "%s", path: "%s".', $name, implode(' -> ', array_keys($this->loading))));