Code Duplication    Length = 7-7 lines in 2 locations

DoctrineBundle.php 2 locations

@@ 107-113 (lines=7) @@
104
105
        // Clear all entity managers to clear references to entities for GC
106
        if ($this->container->hasParameter('doctrine.entity_managers')) {
107
            foreach ($this->container->getParameter('doctrine.entity_managers') as $id) {
108
                if (method_exists($this->container, 'initialized') && ! $this->container->initialized($id)) {
109
                    continue;
110
                }
111
112
                $this->container->get($id)->clear();
113
            }
114
        }
115
116
        // Close all connections to avoid reaching too many connections in the process when booting again later (tests)
@@ 121-127 (lines=7) @@
118
            return;
119
        }
120
121
        foreach ($this->container->getParameter('doctrine.connections') as $id) {
122
            if (method_exists($this->container, 'initialized') && ! $this->container->initialized($id)) {
123
                continue;
124
            }
125
126
            $this->container->get($id)->close();
127
        }
128
    }
129
130
    /**