@@ -1009,11 +1009,7 @@ private function addMethodMap()
1009
1009
private function addAliases ()
1010
1010
{
1011
1011
if (!$ aliases = $ this ->container ->getAliases ()) {
1012
- if ($ this ->container ->isFrozen ()) {
1013
- return "\n \$this->aliases = array(); \n" ;
1014
- } else {
1015
- return '' ;
1016
- }
1012
+ return $ this ->container ->isFrozen () ? "\n \$this->aliases = array(); \n" : '' ;
1017
1013
}
1018
1014
1019
1015
$ code = " \$this->aliases = array( \n" ;
@@ -1382,9 +1378,9 @@ private function dumpValue($value, $interpolate = true)
1382
1378
$ service = $ this ->dumpValue ($ value ->getFactoryService (false ));
1383
1379
1384
1380
return sprintf ('%s->%s(%s) ' , 0 === strpos ($ service , '$ ' ) ? sprintf ('$this->get(%s) ' , $ service ) : $ this ->getServiceCall ($ value ->getFactoryService (false )), $ value ->getFactoryMethod (false ), implode (', ' , $ arguments ));
1385
- } else {
1386
- throw new RuntimeException ('Cannot dump definitions which have factory method without factory service or factory class. ' );
1387
1381
}
1382
+
1383
+ throw new RuntimeException ('Cannot dump definitions which have factory method without factory service or factory class. ' );
1388
1384
}
1389
1385
1390
1386
$ class = $ value ->getClass ();
@@ -1422,9 +1418,9 @@ private function dumpValue($value, $interpolate = true)
1422
1418
}
1423
1419
} elseif (is_object ($ value ) || is_resource ($ value )) {
1424
1420
throw new RuntimeException ('Unable to dump a service container if a parameter is an object or a resource. ' );
1425
- } else {
1426
- return $ this ->export ($ value );
1427
1421
}
1422
+
1423
+ return $ this ->export ($ value );
1428
1424
}
<
B478
/code>
1429
1425
1430
1426
/**
@@ -1493,13 +1489,13 @@ private function getServiceCall($id, Reference $reference = null)
1493
1489
1494
1490
if (null !== $ reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $ reference ->getInvalidBehavior ()) {
1495
1491
return sprintf ('$this->get( \'%s \', ContainerInterface::NULL_ON_INVALID_REFERENCE) ' , $ id );
1496
- } else {
1497
- if ($ this ->container ->hasAlias ($ id )) {
1498
- $ id = (string ) $ this ->container ->getAlias ($ id );
1499
- }
1492
+ }
1500
1493
1501
- return sprintf ('$this->get( \'%s \') ' , $ id );
1494
+ if ($ this ->container ->hasAlias ($ id )) {
1495
+ $ id = (string ) $ this ->container ->getAlias ($ id );
1502
1496
}
1497
+
1498
+ return sprintf ('$this->get( \'%s \') ' , $ id );
1503
1499
}
1504
1500
1505
1501
/**
0 commit comments