Code Duplication    Length = 7-7 lines in 2 locations

DoctrineBundle.php 2 locations

@@ 119-125 (lines=7) @@
116
        }
117
118
        // Clear all entity managers to clear references to entities for GC
119
        if ($this->container->hasParameter('doctrine.entity_managers')) {
120
            foreach ($this->container->getParameter('doctrine.entity_managers') as $id) {
121
                if (!$this->container instanceof IntrospectableContainerInterface || $this->container->initialized($id)) {
122
                    $this->container->get($id)->clear();
123
                }
124
            }
125
        }
126
127
        // Close all connections to avoid reaching too many connections in the process when booting again later (tests)
128
        if ($this->container->hasParameter('doctrine.connections')) {
@@ 128-134 (lines=7) @@
125
        }
126
127
        // Close all connections to avoid reaching too many connections in the process when booting again later (tests)
128
        if ($this->container->hasParameter('doctrine.connections')) {
129
            foreach ($this->container->getParameter('doctrine.connections') as $id) {
130
                if (!$this->container instanceof IntrospectableContainerInterface || $this->container->initialized($id)) {
131
                    $this->container->get($id)->close();
132
                }
133
            }
134
        }
135
    }
136
137
    /**