@@ -334,23 +334,27 @@ public function isEnd(): bool
334334 }
335335
336336 /**
337- * @param array<array-key, string>|string $aEnd
337+ * @param array<array-key, string>|string $stopCharacters
338338 * @param string $bIncludeEnd
339339 * @param string $consumeEnd
340340 * @param array<int, Comment> $comments
341341 *
342342 * @throws UnexpectedEOFException
343343 * @throws UnexpectedTokenException
344344 */
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 ];
348352 $ out = '' ;
349353 $ start = $ this ->currentPosition ;
350354
351355 while (!$ this ->isEnd ()) {
352356 $ char = $ this ->consume (1 );
353- if (\in_array ($ char , $ aEnd , true )) {
357+ if (\in_array ($ char , $ stopCharacters , true )) {
354358 if ($ bIncludeEnd ) {
355359 $ out .= $ char ;
356360 } elseif (!$ consumeEnd ) {
@@ -364,13 +368,13 @@ public function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false, a
364368 }
365369 }
366370
367- if (\in_array (self ::EOF , $ aEnd , true )) {
371+ if (\in_array (self ::EOF , $ stopCharacters , true )) {
368372 return $ out ;
369373 }
370374
371375 $ this ->currentPosition = $ start ;
372376 throw new UnexpectedEOFException (
373- 'One of (" ' . \implode ('"," ' , $ aEnd ) . '") ' ,
377+ 'One of (" ' . \implode ('"," ' , $ stopCharacters ) . '") ' ,
374378 $ this ->peek (5 ),
375379 'search ' ,
376380 $ this ->lineNumber
0 commit comments