@wpkernel/php-json-ast v0.12.6-beta.3
@wpkernel/php-json-ast / buildTernary
Function: buildTernary()
ts
function buildTernary(
cond,
ifExpr,
elseExpr,
attributes?): PhpExprTernary;Builds a PHP ternary expression node.
Parameters
cond
The conditional expression.
ifExpr
The expression to evaluate if the condition is true (can be null for shorthand ternary).
PhpExpr | null
elseExpr
The expression to evaluate if the condition is false.
attributes?
Readonly<Record<string, unknown>>
Optional attributes for the node.
Returns
A PhpExprTernary node.
