Function.php 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * @property bool $byRef Whether returns by reference
  4. * @property string $name Name
  5. * @property PHPParser_Node_Param[] $params Parameters
  6. * @property PHPParser_Node[] $stmts Statements
  7. */
  8. class PHPParser_Node_Stmt_Function extends PHPParser_Node_Stmt
  9. {
  10. /**
  11. * Constructs a function node.
  12. *
  13. * @param string $name Name
  14. * @param array $subNodes Array of the following optional subnodes:
  15. * 'byRef' => false : Whether to return by reference
  16. * 'params' => array(): Parameters
  17. * 'stmts' => array(): Statements
  18. * @param array $attributes Additional attributes
  19. */
  20. public function __construct($name, array $subNodes = array(), array $attributes = array()) {
  21. parent::__construct(
  22. $subNodes + array(
  23. 'byRef' => false,
  24. 'params' => array(),
  25. 'stmts' => array(),
  26. ),
  27. $attributes
  28. );
  29. $this->name = $name;
  30. }
  31. }