Code Duplication    Length = 7-12 lines in 3 locations

src/DependencyInjection/MongoDbBundleExtension.php 3 locations

@@ 113-119 (lines=7) @@
110
        $this->containerBuilder->setDefinition('mongo.client_registry', $clientRegistryDefinition);
111
    }
112
113
    private function defineConnectionFactory()
114
    {
115
        $factoryDefinition = new Definition(ConnectionFactory::class, [new Reference('mongo.client_registry')]);
116
        $factoryDefinition->setPublic(false);
117
118
        $this->containerBuilder->setDefinition('mongo.connection_factory', $factoryDefinition);
119
    }
120
121
    /**
122
     * @param array $connections
@@ 148-159 (lines=12) @@
145
        $this->containerBuilder->setDefinition('facile_mongo_db.event_dispatcher', $eventManagerDefinition);
146
    }
147
148
    private function defineDataCollectorListeners()
149
    {
150
        $dataCollectorListenerDefinition = new Definition(
151
            DataCollectorListener::class,
152
            [
153
                new Reference('facile_mongo_db.logger')
154
            ]
155
        );
156
        $dataCollectorListenerDefinition->setPublic(false);
157
158
        $this->containerBuilder->setDefinition('facile_mongo_db.data_collector.listener', $dataCollectorListenerDefinition);
159
    }
160
161
    private function attachDataCollectionListenerToEventManager()
162
    {
@@ 189-198 (lines=10) @@
186
        $this->containerBuilder->setDefinition('facile_mongo_db.twig_extesion', $extesion);
187
    }
188
189
    private function defineExplainQueryService()
190
    {
191
        $explainServiceDefinition = new Definition(
192
            ExplainQueryService::class,
193
            [new Reference('mongo.client_registry')]
194
        );
195
        $explainServiceDefinition->setPublic(true);
196
197
        $this->containerBuilder->setDefinition('mongo.explain_query_service', $explainServiceDefinition);
198
    }
199
}
200