mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-12-06 05:58:59 +01:00
3ad0d4b310
This adds an additional "returnType" subnode to Stmt\Function_, Stmt\ClassMethod and Expr\Closure, as well as the corresponding support in the name resolver and pretty printer.
34 lines
583 B
Plaintext
34 lines
583 B
Plaintext
Conditional function definition
|
|
-----
|
|
<?php
|
|
|
|
if (true) {
|
|
function A() {}
|
|
}
|
|
-----
|
|
array(
|
|
0: Stmt_If(
|
|
cond: Expr_ConstFetch(
|
|
name: Name(
|
|
parts: array(
|
|
0: true
|
|
)
|
|
)
|
|
)
|
|
stmts: array(
|
|
0: Stmt_Function(
|
|
byRef: false
|
|
name: A
|
|
params: array(
|
|
)
|
|
returnType: null
|
|
stmts: array(
|
|
)
|
|
)
|
|
)
|
|
elseifs: array(
|
|
)
|
|
else: null
|
|
)
|
|
)
|