@@ -334,23 +334,27 @@ public function isEnd(): bool
334
334
}
335
335
336
336
/**
337
- * @param array<array-key, string>|string $aEnd
337
+ * @param array<array-key, string>|string $stopCharacters
338
338
* @param string $bIncludeEnd
339
339
* @param string $consumeEnd
340
340
* @param array<int, Comment> $comments
341
341
*
342
342
* @throws UnexpectedEOFException
343
343
* @throws UnexpectedTokenException
344
344
*/
345
- public function consumeUntil ($ aEnd , $ bIncludeEnd = false , $ consumeEnd = false , array &$ comments = []): string
346
- {
347
- $ aEnd = \is_array ($ aEnd ) ? $ aEnd : [$ aEnd ];
345
+ public function consumeUntil (
346
+ $ stopCharacters ,
347
+ $ bIncludeEnd = false ,
348
+ $ consumeEnd = false ,
349
+ array &$ comments = []
350
+ ): string {
351
+ $ stopCharacters = \is_array ($ stopCharacters ) ? $ stopCharacters : [$ stopCharacters ];
348
352
$ out = '' ;
349
353
$ start = $ this ->currentPosition ;
350
354
351
355
while (!$ this ->isEnd ()) {
352
356
$ char = $ this ->consume (1 );
353
- if (\in_array ($ char , $ aEnd , true )) {
357
+ if (\in_array ($ char , $ stopCharacters , true )) {
354
358
if ($ bIncludeEnd ) {
355
359
$ out .= $ char ;
356
360
} elseif (!$ consumeEnd ) {
@@ -364,13 +368,13 @@ public function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false, a
364
368
}
365
369
}
366
370
367
- if (\in_array (self ::EOF , $ aEnd , true )) {
371
+ if (\in_array (self ::EOF , $ stopCharacters , true )) {
368
372
return $ out ;
369
373
}
370
374
371
375
$ this ->currentPosition = $ start ;
372
376
throw new UnexpectedEOFException (
373
- 'One of (" ' . \implode ('"," ' , $ aEnd ) . '") ' ,
377
+ 'One of (" ' . \implode ('"," ' , $ stopCharacters ) . '") ' ,
374
378
$ this ->peek (5 ),
375
379
'search ' ,
376
380
$ this ->lineNumber
0 commit comments