@wpkernel/php-json-ast v0.12.6-beta.3
@wpkernel/php-json-ast / buildIfStatement
Function: buildIfStatement()
ts
function buildIfStatement(
cond,
stmts,
options,
attributes?): PhpStmtIf;Builds a PHP if statement node.
Parameters
cond
The conditional expression.
stmts
PhpStmt[]
An array of PhpStmt nodes for the if block.
options
Optional configuration for elseif and else branches.
elseBranch?
PhpStmtElse | null
elseifs?
attributes?
Readonly<Record<string, unknown>>
Optional attributes for the node.
Returns
A PhpStmtIf node.
