@@ -50,18 +50,18 @@ public function dump(array $options = []): string
5050
5151 $ this ->dumper ??= new YmlDumper ();
5252
53- return $ this ->container -> resolveEnvPlaceholders ( $ this -> addParameters ()."\n" .$ this ->addServices () );
53+ return $ this ->addParameters ()."\n" .$ this ->addServices ();
5454 }
5555
5656 private function addService (string $ id , Definition $ definition ): string
5757 {
58- $ code = " $ id : \n" ;
58+ $ code = " { $ this -> dumper -> dump ( $ id )} : \n" ;
5959 if ($ class = $ definition ->getClass ()) {
6060 if (str_starts_with ($ class , '\\' )) {
6161 $ class = substr ($ class , 1 );
6262 }
6363
64- $ code .= sprintf (" class: %s \n" , $ this ->dumper ->dump ($ class ));
64+ $ code .= sprintf (" class: %s \n" , $ this ->dumper ->dump ($ this -> container -> resolveEnvPlaceholders ( $ class) ));
6565 }
6666
6767 if (!$ definition ->isPrivate ()) {
@@ -87,7 +87,7 @@ private function addService(string $id, Definition $definition): string
8787 }
8888
8989 if ($ definition ->getFile ()) {
90- $ code .= sprintf (" file: %s \n" , $ this ->dumper ->dump ($ definition ->getFile ()));
90+ $ code .= sprintf (" file: %s \n" , $ this ->dumper ->dump ($ this -> container -> resolveEnvPlaceholders ( $ definition ->getFile () )));
9191 }
9292
9393 if ($ definition ->isSynthetic ()) {
@@ -238,7 +238,7 @@ private function dumpCallable(mixed $callable): mixed
238238 }
239239 }
240240
241- return $ callable ;
241+ return $ this -> container -> resolveEnvPlaceholders ( $ callable) ;
242242 }
243243
244244 /**
@@ -299,7 +299,7 @@ private function dumpValue(mixed $value): mixed
299299 if (\is_array ($ value )) {
300300 $ code = [];
301301 foreach ($ value as $ k => $ v ) {
302- $ code [$ k ] = $ this ->dumpValue ($ v );
302+ $ code [$ this -> container -> resolveEnvPlaceholders ( $ k ) ] = $ this ->dumpValue ($ v );
303303 }
304304
305305 return $ code ;
@@ -319,7 +319,7 @@ private function dumpValue(mixed $value): mixed
319319 throw new RuntimeException (sprintf ('Unable to dump a service container if a parameter is an object or a resource, got "%s". ' , get_debug_type ($ value )));
320320 }
321321
322- return $ value ;
322+ return $ this -> container -> resolveEnvPlaceholders ( $ value) ;
323323 }
324324
325325 private function getServiceCall (string $ id , ?Reference $ reference = null ): string
@@ -359,7 +359,7 @@ private function prepareParameters(array $parameters, bool $escape = true): arra
359359 $ filtered [$ key ] = $ value ;
360360 }
361361
362- return $ escape ? $ this ->escape ($ filtered ) : $ filtered ;
362+ return $ escape ? $ this ->container -> resolveEnvPlaceholders ( $ this -> escape ($ filtered) ) : $ filtered ;
363363 }
364364
365365 private function escape (array $ arguments ): array
0 commit comments