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
192
192
: $ tmp ;
193
193
194
194
} 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 ;
196
200
}
197
201
}
198
202
if ($ args ) {
@@ -202,17 +206,6 @@ public function format(string $statement, ...$args): string
202
206
}
203
207
204
208
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
-
216
209
/**
217
210
* @return object
218
211
* @internal
You can’t perform that action at this time.
0 commit comments