normalizeStringExpr($exprs[0]); for ($i = 1; $i < $numExprs; $i++) { $lastConcat = new Concat($lastConcat, $this->normalizeStringExpr($exprs[$i])); } return $lastConcat; } public function __call($name, array $args) { if (method_exists($this, '_' . $name)) { return $this->{'_' . $name}(...$args); } throw new \LogicException(sprintf('Method "%s" does not exist', $name)); } private function normalizeStringExpr($expr) { if ($expr instanceof Expr) { return $expr; } if (is_string($expr)) { return new String_($expr); } throw new \LogicException('Expected string or Expr'); } }