annotate vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php @ 13:5fb285c0d0e3

Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've been lucky to get away with this so far, as we don't support self-registration which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5 was vulnerable to.
author Chris Cannam
date Mon, 23 Apr 2018 09:33:26 +0100
parents 4c8ae668cc8c
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 }