@@ -184,7 +184,7 @@ public function _initialize()
184
184
$ this ->kernel ->boot ();
185
185
186
186
if ($ this ->config ['cache_router ' ] === true ) {
187
- $ this ->persistService ('router ' , true );
187
+ $ this ->persistPermanentService ('router ' );
188
188
}
189
189
}
190
190
@@ -243,16 +243,16 @@ public function _getEntityManager()
243
243
}
244
244
if (!isset ($ this ->permanentServices [$ this ->config ['em_service ' ]])) {
245
245
// try to persist configured EM
246
- $ this ->persistService ($ this ->config ['em_service ' ], true );
246
+ $ this ->persistPermanentService ($ this ->config ['em_service ' ]);
247
247
248
248
if ($ this ->_getContainer ()->has ('doctrine ' )) {
249
- $ this ->persistService ('doctrine ' , true );
249
+ $ this ->persistPermanentService ('doctrine ' );
250
250
}
251
251
if ($ this ->_getContainer ()->has ('doctrine.orm.default_entity_manager ' )) {
252
- $ this ->persistService ('doctrine.orm.default_entity_manager ' , true );
252
+ $ this ->persistPermanentService ('doctrine.orm.default_entity_manager ' );
253
253
}
254
254
if ($ this ->_getContainer ()->has ('doctrine.dbal.backend_connection ' )) {
255
- $ this ->persistService ('doctrine.dbal.backend_connection ' , true );
255
+ $ this ->persistPermanentService ('doctrine.dbal.backend_connection ' );
256
256
}
257
257
}
258
258
return $ this ->permanentServices [$ this ->config ['em_service ' ]];
@@ -338,18 +338,13 @@ protected function getKernelClass()
338
338
339
339
/**
340
340
* Get service $serviceName and add it to the lists of persistent services.
341
- * If $isPermanent then service becomes persistent between tests
342
341
*
343
- * @param string $serviceName
344
- * @param boolean $isPermanent
342
+ * @param string $serviceName
345
343
*/
346
- public function persistService (string $ serviceName, bool $ isPermanent = false )
344
+ public function persistService (string $ serviceName )
347
345
{
348
346
$ service = $ this ->grabService ($ serviceName );
349
347
$ this ->persistentServices [$ serviceName ] = $ service ;
350
- if ($ isPermanent ) {
351
- $ this ->permanentServices [$ serviceName ] = $ service ;
352
- }
353
348
if ($ this ->client ) {
354
349
$ this ->client ->persistentServices [$ serviceName ] = $ service ;
355
350
}
0 commit comments