2011-05-27 18:20:44 +02:00
|
|
|
<?php
|
|
|
|
|
2014-02-06 14:44:16 +01:00
|
|
|
namespace PhpParser\Node\Stmt;
|
|
|
|
|
|
|
|
use PhpParser\Node;
|
|
|
|
|
2011-05-27 18:20:44 +02:00
|
|
|
/**
|
2014-02-06 14:44:16 +01:00
|
|
|
* @property bool $byRef Whether returns by reference
|
|
|
|
* @property string $name Name
|
|
|
|
* @property Node\Param[] $params Parameters
|
|
|
|
* @property Node[] $stmts Statements
|
2011-05-27 18:20:44 +02:00
|
|
|
*/
|
2014-02-06 14:44:16 +01:00
|
|
|
class Function_ extends Node\Stmt
|
2011-05-27 18:20:44 +02:00
|
|
|
{
|
2011-10-28 19:06:24 +02:00
|
|
|
/**
|
|
|
|
* Constructs a function node.
|
|
|
|
*
|
2012-04-29 23:32:09 +02:00
|
|
|
* @param string $name Name
|
|
|
|
* @param array $subNodes Array of the following optional subnodes:
|
|
|
|
* 'byRef' => false : Whether to return by reference
|
|
|
|
* 'params' => array(): Parameters
|
|
|
|
* 'stmts' => array(): Statements
|
|
|
|
* @param array $attributes Additional attributes
|
2011-10-28 19:06:24 +02:00
|
|
|
*/
|
2012-04-29 23:32:09 +02:00
|
|
|
public function __construct($name, array $subNodes = array(), array $attributes = array()) {
|
2011-10-28 19:06:24 +02:00
|
|
|
parent::__construct(
|
|
|
|
$subNodes + array(
|
|
|
|
'byRef' => false,
|
|
|
|
'params' => array(),
|
|
|
|
'stmts' => array(),
|
|
|
|
),
|
2012-04-29 23:32:09 +02:00
|
|
|
$attributes
|
2011-10-28 19:06:24 +02:00
|
|
|
);
|
|
|
|
$this->name = $name;
|
|
|
|
}
|
2011-05-27 18:20:44 +02:00
|
|
|
}
|