Mercurial > hg > isophonics-drupal-site
annotate vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.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\Expr; |
Chris@0 | 4 |
Chris@0 | 5 use PhpParser\Node\Expr; |
Chris@0 | 6 |
Chris@0 | 7 class ArrayItem extends Expr |
Chris@0 | 8 { |
Chris@0 | 9 /** @var null|Expr Key */ |
Chris@0 | 10 public $key; |
Chris@0 | 11 /** @var Expr Value */ |
Chris@0 | 12 public $value; |
Chris@0 | 13 /** @var bool Whether to assign by reference */ |
Chris@0 | 14 public $byRef; |
Chris@0 | 15 |
Chris@0 | 16 /** |
Chris@0 | 17 * Constructs an array item node. |
Chris@0 | 18 * |
Chris@0 | 19 * @param Expr $value Value |
Chris@0 | 20 * @param null|Expr $key Key |
Chris@0 | 21 * @param bool $byRef Whether to assign by reference |
Chris@0 | 22 * @param array $attributes Additional attributes |
Chris@0 | 23 */ |
Chris@13 | 24 public function __construct(Expr $value, Expr $key = null, bool $byRef = false, array $attributes = []) { |
Chris@0 | 25 parent::__construct($attributes); |
Chris@0 | 26 $this->key = $key; |
Chris@0 | 27 $this->value = $value; |
Chris@0 | 28 $this->byRef = $byRef; |
Chris@0 | 29 } |
Chris@0 | 30 |
Chris@13 | 31 public function getSubNodeNames() : array { |
Chris@13 | 32 return ['key', 'value', 'byRef']; |
Chris@13 | 33 } |
Chris@13 | 34 |
Chris@13 | 35 public function getType() : string { |
Chris@13 | 36 return 'Expr_ArrayItem'; |
Chris@0 | 37 } |
Chris@0 | 38 } |