Skip to content

Commit 262ac24

Browse files
authored
[CLEANUP] Avoid Hungarian notation for stopCharacters (#1124)
Part of #756
1 parent 9eb6c43 commit 262ac24

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/Parsing/ParserState.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)