@@ -1009,11 +1009,7 @@ private function addMethodMap()
10091009 private function addAliases ()
10101010 {
10111011 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" : '' ;
10171013 }
10181014
10191015 $ code = " \$this->aliases = array( \n" ;
@@ -1382,9 +1378,9 @@ private function dumpValue($value, $interpolate = true)
13821378 $ service = $ this ->dumpValue ($ value ->getFactoryService (false ));
13831379
13841380 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. ' );
13871381 }
1382+
1383+ throw new RuntimeException ('Cannot dump definitions which have factory method without factory service or factory class. ' );
13881384 }
13891385
13901386 $ class = $ value ->getClass ();
@@ -1422,9 +1418,9 @@ private function dumpValue($value, $interpolate = true)
14221418 }
14231419 } elseif (is_object ($ value ) || is_resource ($ value )) {
14241420 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 );
14271421 }
1422+
1423+ return $ this ->export ($ value );
14281424 }
14291425
14301426 /**
@@ -1493,13 +1489,13 @@ private function getServiceCall($id, Reference $reference = null)
14931489
14941490 if (null !== $ reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $ reference ->getInvalidBehavior ()) {
14951491 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+ }
15001493
1501- return sprintf ('$this->get( \'%s \') ' , $ id );
1494+ if ($ this ->container ->hasAlias ($ id )) {
1495+ $ id = (string ) $ this ->container ->getAlias ($ id );
15021496 }
1497+
1498+ return sprintf ('$this->get( \'%s \') ' , $ id );
15031499 }
15041500
15051501 /**
0 commit comments