Code Duplication    Length = 7-7 lines in 2 locations

DoctrineBundle.php 2 locations

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