function Standard::pExpr_Ternary
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ PrettyPrinter/ Standard.php, line 714
Class
Namespace
PhpParser\PrettyPrinterCode
protected function pExpr_Ternary(Expr\Ternary $node, int $precedence, int $lhsPrecedence) : string {
// a bit of cheating: we treat the ternary as a binary op where the ?...: part is the operator.
// this is okay because the part between ? and : never needs parentheses.
return $this->pInfixOp(Expr\Ternary::class, $node->cond, ' ?' . (null !== $node->if ? ' ' . $this->p($node->if) . ' ' : '') . ': ', $node->else, $precedence, $lhsPrecedence);
}