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