Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[CLEANUP] Avoid Hungarian notation for numberOfLines
Part of #756
  • Loading branch information
oliverklee committed Mar 8, 2025
commit 0c86ed7622892dd1f93dae56ed8227c48cae1acf
8 changes: 4 additions & 4 deletions src/Parsing/ParserState.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public function peek($length = 1, $offset = 0): string
public function consume($value = 1): string
{
if (\is_string($value)) {
$iLineCount = \substr_count($value, "\n");
$numberOfLines = \substr_count($value, "\n");
$length = $this->strlen($value);
if (!$this->streql($this->substr($this->currentPosition, $length), $value)) {
throw new UnexpectedTokenException(
Expand All @@ -269,16 +269,16 @@ public function consume($value = 1): string
$this->lineNumber
);
}
$this->lineNumber += $iLineCount;
$this->lineNumber += $numberOfLines;
$this->currentPosition += $this->strlen($value);
return $value;
} else {
if ($this->currentPosition + $value > \count($this->characters)) {
throw new UnexpectedEOFException((string) $value, $this->peek(5), 'count', $this->lineNumber);
}
$result = $this->substr($this->currentPosition, $value);
$iLineCount = \substr_count($result, "\n");
$this->lineNumber += $iLineCount;
$numberOfLines = \substr_count($result, "\n");
$this->lineNumber += $numberOfLines;
$this->currentPosition += $value;
return $result;
}
Expand Down