File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -581,7 +581,7 @@ public function complete()
581581
582582
583583 /**
584- * @return void
584+ * @return Statement
585585 */
586586 public function completeStatement (Statement $ statement )
587587 {
@@ -934,9 +934,17 @@ public function formatPhp($statement, $args)
934934 {
935935 array_walk_recursive ($ args , function (& $ val ) {
936936 if ($ val instanceof Statement) {
937- $ val = self ::literal ($ this ->formatStatement ($ val ));
937+ $ val = self ::literal ($ this ->formatStatement ($ this ->completeStatement ($ val )));
938+
939+ } elseif ($ val === $ this ) {
940+ trigger_error ("Replace object ContainerBuilder in Statement arguments with '@container'. " , E_USER_DEPRECATED );
941+ $ val = self ::literal ('$this ' );
942+
943+ } elseif ($ val instanceof ServiceDefinition) {
944+ $ val = '@ ' . current (array_keys ($ this ->getDefinitions (), $ val , TRUE ));
945+ }
938946
939- } elseif (is_string ($ val ) && substr ($ val , 0 , 2 ) === '@@ ' ) { // escaped text @@
947+ if (is_string ($ val ) && substr ($ val , 0 , 2 ) === '@@ ' ) { // escaped text @@
940948 $ val = substr ($ val , 1 );
941949
942950 } elseif (is_string ($ val ) && substr ($ val , 0 , 1 ) === '@ ' && strlen ($ val ) > 1 ) { // service reference
You can’t perform that action at this time.
0 commit comments