@@ -1029,11 +1029,7 @@ private function addMethodMap()
1029
1029
private function addAliases ()
1030
1030
{
1031
1031
if (!$ aliases = $ this ->container ->getAliases ()) {
1032
- if ($ this ->container ->isFrozen ()) {
1033
- return "\n \$this->aliases = array(); \n" ;
1034
- } else {
1035
- return '' ;
1036
- }
1032
+ return $ this ->container ->isFrozen () ? "\n \$this->aliases = array(); \n" : '' ;
1037
1033
}
1038
1034
1039
1035
$ code = " \$this->aliases = array( \n" ;
@@ -1402,9 +1398,9 @@ private function dumpValue($value, $interpolate = true)
1402
1398
$ service = $ this ->dumpValue ($ value ->getFactoryService (false ));
1403
1399
1404
1400
return sprintf ('%s->%s(%s) ' , 0 === strpos ($ service , '$ ' ) ? sprintf ('$this->get(%s) ' , $ service ) : $ this ->getServiceCall ($ value ->getFactoryService (false )), $ value ->getFactoryMethod (false ), implode (', ' , $ arguments ));
1405
- } else {
1406
- throw new RuntimeException ('Cannot dump definitions which have factory method without factory service or factory class. ' );
1407
1401
}
1402
+
1403
+ throw new RuntimeException ('Cannot dump definitions which have factory method without factory service or factory class. ' );
1408
1404
}
1409
1405
1410
1406
$ class = $ value ->getClass ();
@@ -1442,9 +1438,9 @@ private function dumpValue($value, $interpolate = true)
1442
1438
}
1443
1439
} elseif (is_object ($ value ) || is_resource ($ value )) {
1444
1440
throw new RuntimeException ('Unable to dump a service container if a parameter is an object or a resource. ' );
1445
- } else {
1446
- return $ this ->export ($ value );
1447
1441
}
1442
+
1443
+ return $ this ->export ($ value );
1448
1444
}
1449
1445
1450
1446
/**
@@ -1513,13 +1509,13 @@ private function getServiceCall($id, Reference $reference = null)
1513
1509
1514
1510
if (null !== $ reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $ reference ->getInvalidBehavior ()) {
1515
1511
return sprintf ('$this->get( \'%s \', ContainerInterface::NULL_ON_INVALID_REFERENCE) ' , $ id );
1516
- } else {
1517
- if ($ this ->container ->hasAlias ($ id )) {
1518
- $ id = (string ) $ this ->container ->getAlias ($ id );
1519
- }
1512
+ }
1520
1513
1521
- return sprintf ('$this->get( \'%s \') ' , $ id );
1514
+ if ($ this ->container ->hasAlias ($ id )) {
1515
+ $ id = (string ) $ this ->container ->getAlias ($ id );
1522
1516
}
1517
+
1518
+ return sprintf ('$this->get( \'%s \') ' , $ id );
1523
1519
}
1524
1520
1525
1521
/**
0 commit comments