PhpParser\PrettyPrinter\Standard::pExpr_Ternary PHP Method

pExpr_Ternary() protected method

protected pExpr_Ternary ( PhpParser\Node\Expr\Ternary $node )
$node PhpParser\Node\Expr\Ternary
    protected function pExpr_Ternary(Expr\Ternary $node) {
        // 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',
            $node->cond, ' ?' . (null !== $node->if ? ' ' . $this->p($node->if) . ' ' : '') . ': ', $node->else
        );
    }
Standard