comparison 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
comparison
equal deleted inserted replaced
12:7a779792577d 13:5fb285c0d0e3
1 <?php 1 <?php declare(strict_types=1);
2 2
3 namespace PhpParser\Node; 3 namespace PhpParser\Node;
4 4
5 use PhpParser\NodeAbstract; 5 use PhpParser\NodeAbstract;
6 6
7 /**
8 * @property Name $namespacedName Namespaced name (for class constants, if using NameResolver)
9 */
7 class Const_ extends NodeAbstract 10 class Const_ extends NodeAbstract
8 { 11 {
9 /** @var string Name */ 12 /** @var Identifier Name */
10 public $name; 13 public $name;
11 /** @var Expr Value */ 14 /** @var Expr Value */
12 public $value; 15 public $value;
13 16
14 /** 17 /**
15 * Constructs a const node for use in class const and const statements. 18 * Constructs a const node for use in class const and const statements.
16 * 19 *
17 * @param string $name Name 20 * @param string|Identifier $name Name
18 * @param Expr $value Value 21 * @param Expr $value Value
19 * @param array $attributes Additional attributes 22 * @param array $attributes Additional attributes
20 */ 23 */
21 public function __construct($name, Expr $value, array $attributes = array()) { 24 public function __construct($name, Expr $value, array $attributes = []) {
22 parent::__construct($attributes); 25 parent::__construct($attributes);
23 $this->name = $name; 26 $this->name = \is_string($name) ? new Identifier($name) : $name;
24 $this->value = $value; 27 $this->value = $value;
25 } 28 }
26 29
27 public function getSubNodeNames() { 30 public function getSubNodeNames() : array {
28 return array('name', 'value'); 31 return ['name', 'value'];
32 }
33
34 public function getType() : string {
35 return 'Const';
29 } 36 }
30 } 37 }