Code Duplication    Length = 15-16 lines in 2 locations

src/DoctrineMongoServiceProvider.php 1 location

@@ 148-162 (lines=15) @@
145
     *
146
     * @return callable
147
     */
148
    private function getMongoDbsEventManagerDefinition(Container $container): callable
149
    {
150
        return function () use ($container) {
151
            $container['doctrine.mongo.dbs.options.initializer']();
152
153
            $managers = new Container();
154
            foreach ($container['doctrine.mongo.dbs.options'] as $name => $options) {
155
                $managers[$name] = function () {
156
                    return new EventManager();
157
                };
158
            }
159
160
            return $managers;
161
        };
162
    }
163
164
    /***
165
     * @param Container $container

src/DoctrineDbalServiceProvider.php 1 location

@@ 169-184 (lines=16) @@
166
     *
167
     * @return callable
168
     */
169
    private function getDbsEventManagerDefinition(Container $container): callable
170
    {
171
        return function () use ($container) {
172
            $container['doctrine.dbal.dbs.options.initializer']();
173
174
            $managers = new Container();
175
            foreach ($container['doctrine.dbal.dbs.options'] as $name => $options) {
176
                $managers[$name] = function () {
177
                    return new EventManager();
178
                    // todo: check for set/add methods to implement
179
                };
180
            }
181
182
            return $managers;
183
        };
184
    }
185
186
    /***
187
     * @param Container $container