@wpkernel/php-json-ast v0.12.6-beta.3
@wpkernel/php-json-ast / buildScalarCast
Function: buildScalarCast()
ts
function buildScalarCast(
kind,
expr,
attributes?): PhpExprCastScalar;Builds a PHP scalar cast expression node (int, float, string, bool).
Parameters
kind
The type to cast to ('int', 'float', 'string', or 'bool').
"string" | "int" | "float" | "bool"
expr
The expression to cast.
attributes?
Readonly<Record<string, unknown>>
Optional attributes for the node.
Returns
A PhpExprCastScalar node.
