Mercurial > hg > isophonics-drupal-site
annotate vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.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\Stmt; |
Chris@0 | 4 |
Chris@0 | 5 use PhpParser\Node\Stmt; |
Chris@0 | 6 |
Chris@0 | 7 class Use_ extends Stmt |
Chris@0 | 8 { |
Chris@0 | 9 /** |
Chris@0 | 10 * Unknown type. Both Stmt\Use_ / Stmt\GroupUse and Stmt\UseUse have a $type property, one of them will always be |
Chris@0 | 11 * TYPE_UNKNOWN while the other has one of the three other possible types. For normal use statements the type on the |
Chris@0 | 12 * Stmt\UseUse is unknown. It's only the other way around for mixed group use declarations. |
Chris@0 | 13 */ |
Chris@0 | 14 const TYPE_UNKNOWN = 0; |
Chris@0 | 15 /** Class or namespace import */ |
Chris@0 | 16 const TYPE_NORMAL = 1; |
Chris@0 | 17 /** Function import */ |
Chris@0 | 18 const TYPE_FUNCTION = 2; |
Chris@0 | 19 /** Constant import */ |
Chris@0 | 20 const TYPE_CONSTANT = 3; |
Chris@0 | 21 |
Chris@0 | 22 /** @var int Type of alias */ |
Chris@0 | 23 public $type; |
Chris@0 | 24 /** @var UseUse[] Aliases */ |
Chris@0 | 25 public $uses; |
Chris@0 | 26 |
Chris@0 | 27 /** |
Chris@0 | 28 * Constructs an alias (use) list node. |
Chris@0 | 29 * |
Chris@0 | 30 * @param UseUse[] $uses Aliases |
Chris@0 | 31 * @param int $type Type of alias |
Chris@0 | 32 * @param array $attributes Additional attributes |
Chris@0 | 33 */ |
Chris@0 | 34 public function __construct(array $uses, $type = self::TYPE_NORMAL, array $attributes = array()) { |
Chris@0 | 35 parent::__construct($attributes); |
Chris@0 | 36 $this->type = $type; |
Chris@0 | 37 $this->uses = $uses; |
Chris@0 | 38 } |
Chris@0 | 39 |
Chris@0 | 40 public function getSubNodeNames() { |
Chris@0 | 41 return array('type', 'uses'); |
Chris@0 | 42 } |
Chris@0 | 43 } |