Mercurial > hg > isophonics-drupal-site
annotate vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 5fb285c0d0e3 |
children |
rev | line source |
---|---|
Chris@13 | 1 <?php declare(strict_types=1); |
Chris@0 | 2 |
Chris@0 | 3 namespace PhpParser\Node; |
Chris@0 | 4 |
Chris@0 | 5 use PhpParser\NodeAbstract; |
Chris@0 | 6 |
Chris@13 | 7 /** |
Chris@13 | 8 * @property Name $namespacedName Namespaced name (for class constants, if using NameResolver) |
Chris@13 | 9 */ |
Chris@0 | 10 class Const_ extends NodeAbstract |
Chris@0 | 11 { |
Chris@13 | 12 /** @var Identifier Name */ |
Chris@0 | 13 public $name; |
Chris@0 | 14 /** @var Expr Value */ |
Chris@0 | 15 public $value; |
Chris@0 | 16 |
Chris@0 | 17 /** |
Chris@0 | 18 * Constructs a const node for use in class const and const statements. |
Chris@0 | 19 * |
Chris@13 | 20 * @param string|Identifier $name Name |
Chris@13 | 21 * @param Expr $value Value |
Chris@13 | 22 * @param array $attributes Additional attributes |
Chris@0 | 23 */ |
Chris@13 | 24 public function __construct($name, Expr $value, array $attributes = []) { |
Chris@0 | 25 parent::__construct($attributes); |
Chris@13 | 26 $this->name = \is_string($name) ? new Identifier($name) : $name; |
Chris@0 | 27 $this->value = $value; |
Chris@0 | 28 } |
Chris@0 | 29 |
Chris@13 | 30 public function getSubNodeNames() : array { |
Chris@13 | 31 return ['name', 'value']; |
Chris@13 | 32 } |
Chris@13 | 33 |
Chris@13 | 34 public function getType() : string { |
Chris@13 | 35 return 'Const'; |
Chris@0 | 36 } |
Chris@0 | 37 } |