Mercurial > hg > isophonics-drupal-site
annotate vendor/nikic/php-parser/lib/PhpParser/Node/Param.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 5fb285c0d0e3 |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace PhpParser\Node; |
Chris@0 | 4 |
Chris@0 | 5 use PhpParser\NodeAbstract; |
Chris@0 | 6 |
Chris@0 | 7 class Param extends NodeAbstract |
Chris@0 | 8 { |
Chris@0 | 9 /** @var null|string|Name|NullableType Typehint */ |
Chris@0 | 10 public $type; |
Chris@0 | 11 /** @var bool Whether parameter is passed by reference */ |
Chris@0 | 12 public $byRef; |
Chris@0 | 13 /** @var bool Whether this is a variadic argument */ |
Chris@0 | 14 public $variadic; |
Chris@0 | 15 /** @var string Name */ |
Chris@0 | 16 public $name; |
Chris@0 | 17 /** @var null|Expr Default value */ |
Chris@0 | 18 public $default; |
Chris@0 | 19 |
Chris@0 | 20 /** |
Chris@0 | 21 * Constructs a parameter node. |
Chris@0 | 22 * |
Chris@0 | 23 * @param string $name Name |
Chris@0 | 24 * @param null|Expr $default Default value |
Chris@0 | 25 * @param null|string|Name|NullableType $type Typehint |
Chris@0 | 26 * @param bool $byRef Whether is passed by reference |
Chris@0 | 27 * @param bool $variadic Whether this is a variadic argument |
Chris@0 | 28 * @param array $attributes Additional attributes |
Chris@0 | 29 */ |
Chris@0 | 30 public function __construct($name, Expr $default = null, $type = null, $byRef = false, $variadic = false, array $attributes = array()) { |
Chris@0 | 31 parent::__construct($attributes); |
Chris@0 | 32 $this->type = $type; |
Chris@0 | 33 $this->byRef = $byRef; |
Chris@0 | 34 $this->variadic = $variadic; |
Chris@0 | 35 $this->name = $name; |
Chris@0 | 36 $this->default = $default; |
Chris@0 | 37 } |
Chris@0 | 38 |
Chris@0 | 39 public function getSubNodeNames() { |
Chris@0 | 40 return array('type', 'byRef', 'variadic', 'name', 'default'); |
Chris@0 | 41 } |
Chris@0 | 42 } |