2011-10-26 18:34:12 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property PHPParser_Node[] $stmts Statements
|
|
|
|
* @property PHPParser_Node_Stmt_FuncParam[] $params Parameters
|
|
|
|
* @property PHPParser_Node_Expr_ClosureUse[] $uses use()s
|
|
|
|
* @property bool $byRef Whether to return by reference
|
2011-10-29 00:16:29 +02:00
|
|
|
* @property bool $static Whether the closure is static
|
2011-10-26 18:34:12 +02:00
|
|
|
*/
|
|
|
|
class PHPParser_Node_Expr_Closure extends PHPParser_Node_Expr
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Constructs a lambda function node.
|
|
|
|
*
|
2011-10-28 19:06:24 +02:00
|
|
|
* @param array $subNodes Array of the following optional subnodes:
|
|
|
|
* 'stmts' => array(): Statements
|
|
|
|
* 'params' => array(): Parameters
|
|
|
|
* 'uses' => array(): use()s
|
|
|
|
* 'byRef' => false : Whether to return by reference
|
2011-10-29 00:16:29 +02:00
|
|
|
* 'static' => false : Whether the closure is static
|
2011-10-28 19:06:24 +02:00
|
|
|
* @param int $line Line
|
|
|
|
* @param null|string $docComment Nearest doc comment
|
2011-10-26 18:34:12 +02:00
|
|
|
*/
|
2011-10-28 19:06:24 +02:00
|
|
|
public function __construct(array $subNodes = array(), $line = -1, $docComment = null) {
|
2011-10-26 18:34:12 +02:00
|
|
|
parent::__construct(
|
2011-10-28 19:06:24 +02:00
|
|
|
$subNodes + array(
|
|
|
|
'stmts' => array(),
|
|
|
|
'params' => array(),
|
|
|
|
'uses' => array(),
|
|
|
|
'byRef' => false,
|
2011-10-29 00:16:29 +02:00
|
|
|
'static' => false,
|
2011-10-26 18:34:12 +02:00
|
|
|
),
|
|
|
|
$line, $docComment
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|