Mercurial > hg > isophonics-drupal-site
comparison vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
12:7a779792577d | 13:5fb285c0d0e3 |
---|---|
1 <?php | 1 <?php declare(strict_types=1); |
2 | 2 |
3 namespace PhpParser\Node\Stmt; | 3 namespace PhpParser\Node\Stmt; |
4 | 4 |
5 use PhpParser\Node; | 5 use PhpParser\Node; |
6 | 6 |
16 * | 16 * |
17 * @param Node\Const_[] $consts Constant declarations | 17 * @param Node\Const_[] $consts Constant declarations |
18 * @param int $flags Modifiers | 18 * @param int $flags Modifiers |
19 * @param array $attributes Additional attributes | 19 * @param array $attributes Additional attributes |
20 */ | 20 */ |
21 public function __construct(array $consts, $flags = 0, array $attributes = array()) { | 21 public function __construct(array $consts, int $flags = 0, array $attributes = []) { |
22 parent::__construct($attributes); | 22 parent::__construct($attributes); |
23 $this->flags = $flags; | 23 $this->flags = $flags; |
24 $this->consts = $consts; | 24 $this->consts = $consts; |
25 } | 25 } |
26 | 26 |
27 public function getSubNodeNames() { | 27 public function getSubNodeNames() : array { |
28 return array('flags', 'consts'); | 28 return ['flags', 'consts']; |
29 } | 29 } |
30 | 30 |
31 public function isPublic() { | 31 /** |
32 * Whether constant is explicitly or implicitly public. | |
33 * | |
34 * @return bool | |
35 */ | |
36 public function isPublic() : bool { | |
32 return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 | 37 return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 |
33 || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; | 38 || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; |
34 } | 39 } |
35 | 40 |
36 public function isProtected() { | 41 /** |
42 * Whether constant is protected. | |
43 * | |
44 * @return bool | |
45 */ | |
46 public function isProtected() : bool { | |
37 return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); | 47 return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); |
38 } | 48 } |
39 | 49 |
40 public function isPrivate() { | 50 /** |
51 * Whether constant is private. | |
52 * | |
53 * @return bool | |
54 */ | |
55 public function isPrivate() : bool { | |
41 return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); | 56 return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); |
42 } | 57 } |
43 | 58 |
44 public function isStatic() { | 59 public function getType() : string { |
45 return (bool) ($this->flags & Class_::MODIFIER_STATIC); | 60 return 'Stmt_ClassConst'; |
46 } | 61 } |
47 } | 62 } |