Skip to content

Commit 13156aa

Browse files
committed
Simplify string concatenation
1 parent 4f80e76 commit 13156aa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ParserAbstract.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,16 +380,16 @@ protected function getErrorMessage(int $symbol, int $state, int $line): string
380380
{
381381
$expectedString = '';
382382
if ($expected = $this->getExpectedTokens($state)) {
383-
$expectedString = ': Expecting ' . implode(' or ', $expected);
383+
$expectedString = ': Expecting ' . implode(', ', $expected);
384384
}
385385

386-
return "Parse error on line $line" . $expectedString . ', got ' . $this->symbolToName[$symbol];
386+
return "Parse error on line {$line}{$expectedString}, got {$this->symbolToName[$symbol]}";
387387
}
388388

389389
private function getNodeError(string $message, Node $node): string
390390
{
391391
$start = $node->loc->start;
392-
return $message . ' - ' . $start->line . ':' . $start->column;
392+
return "{$message} - {$start->line}:{$start->column}";
393393
}
394394

395395
/**
@@ -622,7 +622,7 @@ protected function preparePath(bool $data, SubExpression|null $sexpr, array $par
622622
$depth++;
623623
}
624624
} else {
625-
$tail[] = "{$partPrefix}{$part}";
625+
$tail[] = $partPrefix . $part;
626626
}
627627
}
628628

@@ -690,7 +690,7 @@ protected function prepareBlock(
690690
$firstStmt = $inverseAndProgram->program->body[0];
691691

692692
if (!$firstStmt instanceof BlockStatement && !$firstStmt instanceof PartialBlockStatement) {
693-
throw new \Exception('Unexpected statement type: ' . $firstStmt->type);
693+
throw new \Exception("Unexpected statement type: {$firstStmt->type}");
694694
}
695695

696696
$firstStmt->closeStrip = $close->strip;

0 commit comments

Comments
 (0)