Closure.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * @property PHPParser_Node[] $stmts Statements
  4. * @property PHPParser_Node_Param[] $params Parameters
  5. * @property PHPParser_Node_Expr_ClosureUse[] $uses use()s
  6. * @property bool $byRef Whether to return by reference
  7. * @property bool $static Whether the closure is static
  8. */
  9. class PHPParser_Node_Expr_Closure extends PHPParser_Node_Expr
  10. {
  11. /**
  12. * Constructs a lambda function node.
  13. *
  14. * @param array $subNodes Array of the following optional subnodes:
  15. * 'stmts' => array(): Statements
  16. * 'params' => array(): Parameters
  17. * 'uses' => array(): use()s
  18. * 'byRef' => false : Whether to return by reference
  19. * 'static' => false : Whether the closure is static
  20. * @param array $attributes Additional attributes
  21. */
  22. public function __construct(array $subNodes = array(), array $attributes = array()) {
  23. parent::__construct(
  24. $subNodes + array(
  25. 'stmts' => array(),
  26. 'params' => array(),
  27. 'uses' => array(),
  28. 'byRef' => false,
  29. 'static' => false,
  30. ),
  31. $attributes
  32. );
  33. }
  34. }