Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace PhpParser\Node\Stmt;
|
Chris@0
|
4
|
Chris@0
|
5 use PhpParser\Node;
|
Chris@0
|
6
|
Chris@0
|
7 class Property extends Node\Stmt
|
Chris@0
|
8 {
|
Chris@0
|
9 /** @var int Modifiers */
|
Chris@0
|
10 public $flags;
|
Chris@0
|
11 /** @var PropertyProperty[] Properties */
|
Chris@0
|
12 public $props;
|
Chris@0
|
13
|
Chris@0
|
14 /** @deprecated Use $flags instead */
|
Chris@0
|
15 public $type;
|
Chris@0
|
16
|
Chris@0
|
17 /**
|
Chris@0
|
18 * Constructs a class property list node.
|
Chris@0
|
19 *
|
Chris@0
|
20 * @param int $flags Modifiers
|
Chris@0
|
21 * @param PropertyProperty[] $props Properties
|
Chris@0
|
22 * @param array $attributes Additional attributes
|
Chris@0
|
23 */
|
Chris@0
|
24 public function __construct($flags, array $props, array $attributes = array()) {
|
Chris@0
|
25 parent::__construct($attributes);
|
Chris@0
|
26 $this->flags = $flags;
|
Chris@0
|
27 $this->type = $flags;
|
Chris@0
|
28 $this->props = $props;
|
Chris@0
|
29 }
|
Chris@0
|
30
|
Chris@0
|
31 public function getSubNodeNames() {
|
Chris@0
|
32 return array('flags', 'props');
|
Chris@0
|
33 }
|
Chris@0
|
34
|
Chris@0
|
35 public function isPublic() {
|
Chris@0
|
36 return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0
|
Chris@0
|
37 || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0;
|
Chris@0
|
38 }
|
Chris@0
|
39
|
Chris@0
|
40 public function isProtected() {
|
Chris@0
|
41 return (bool) ($this->flags & Class_::MODIFIER_PROTECTED);
|
Chris@0
|
42 }
|
Chris@0
|
43
|
Chris@0
|
44 public function isPrivate() {
|
Chris@0
|
45 return (bool) ($this->flags & Class_::MODIFIER_PRIVATE);
|
Chris@0
|
46 }
|
Chris@0
|
47
|
Chris@0
|
48 public function isStatic() {
|
Chris@0
|
49 return (bool) ($this->flags & Class_::MODIFIER_STATIC);
|
Chris@0
|
50 }
|
Chris@0
|
51 }
|