File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,11 @@ public function format(string $statement, ...$args): string
192192 : $ tmp ;
193193
194194 } else { // $ -> ::
195- $ res .= substr ($ token , 0 , -1 ) . $ this ->formatMember (array_shift ($ args ));
195+ $ arg = array_shift ($ args );
196+ if ($ arg instanceof PhpLiteral || !Helpers::isIdentifier ($ arg )) {
197+ $ arg = '{ ' . $ this ->dumpVar ($ arg ) . '} ' ;
198+ }
199+ $ res .= substr ($ token , 0 , -1 ) . $ arg ;
196200 }
197201 }
198202 if ($ args ) {
@@ -202,17 +206,6 @@ public function format(string $statement, ...$args): string
202206 }
203207
204208
205- /**
206- * Returns a PHP representation of a object member.
207- */
208- private function formatMember ($ name ): string
209- {
210- return $ name instanceof PhpLiteral || !Helpers::isIdentifier ($ name )
211- ? '{ ' . $ this ->dumpVar ($ name ) . '} '
212- : $ name ;
213- }
214-
215-
216209 /**
217210 * @return object
218211 * @internal
You can’t perform that action at this time.
0 commit comments