function BuilderFactory::concat
Creates nested Concat nodes from a list of expressions.
Parameters
Expr|string ...$exprs Expressions or literal strings:
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ BuilderFactory.php, line 348
Class
Namespace
PhpParserCode
public function concat(...$exprs) : Concat {
$numExprs = count($exprs);
if ($numExprs < 2) {
throw new \LogicException('Expected at least two expressions');
}
$lastConcat = $this->normalizeStringExpr($exprs[0]);
for ($i = 1; $i < $numExprs; $i++) {
$lastConcat = new Concat($lastConcat, $this->normalizeStringExpr($exprs[$i]));
}
return $lastConcat;
}