| 1 | <?php |
||
| 8 | class Property extends Node\Stmt |
||
| 9 | { |
||
| 10 | /** @var int Modifiers */ |
||
| 11 | public $type; |
||
| 12 | /** @var PropertyProperty[] Properties */ |
||
| 13 | public $props; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Constructs a class property list node. |
||
| 17 | * |
||
| 18 | * @param int $type Modifiers |
||
| 19 | * @param PropertyProperty[] $props Properties |
||
| 20 | * @param array $attributes Additional attributes |
||
| 21 | */ |
||
| 22 | public function __construct($type, array $props, array $attributes = array()) { |
||
| 23 | if ($type & Class_::MODIFIER_ABSTRACT) { |
||
| 24 | throw new Error('Properties cannot be declared abstract'); |
||
| 25 | } |
||
| 26 | |||
| 27 | if ($type & Class_::MODIFIER_FINAL) { |
||
| 28 | throw new Error('Properties cannot be declared final'); |
||
| 29 | } |
||
| 30 | |||
| 31 | parent::__construct($attributes); |
||
| 32 | $this->type = $type; |
||
| 33 | $this->props = $props; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getSubNodeNames() { |
||
| 39 | |||
| 40 | public function isPublic() { |
||
| 44 | |||
| 45 | public function isProtected() { |
||
| 48 | |||
| 49 | public function isPrivate() { |
||
| 50 | return (bool) ($this->type & Class_::MODIFIER_PRIVATE); |
||
| 51 | } |
||
| 52 | |||
| 53 | public function isStatic() { |
||
| 56 | } |
||
| 57 |