summaryrefslogtreecommitdiff
path: root/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-07-12 22:26:21 +0300
committerAndrew Dolgov <[email protected]>2022-07-12 22:26:21 +0300
commit80d3db1dcf8fe9ca66d4e3f2e2116d3bc39ae2b4 (patch)
tree04b33bfb9c9368c4a31e287153abec690b9014e0 /vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php
parent4b6161892000cb2b8392dce92a9cf2cabdf2d20e (diff)
upgrade idiorm to php8.1-patched version (aaronpk/idiorm)
Diffstat (limited to 'vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php')
-rw-r--r--vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php
index b290aaf6d..52ed6c6cd 100644
--- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php
+++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php
@@ -68,6 +68,10 @@ class Class_ extends ClassLike
return (bool) ($this->flags & self::MODIFIER_FINAL);
}
+ public function isReadonly() : bool {
+ return (bool) ($this->flags & self::MODIFIER_READONLY);
+ }
+
/**
* Whether the class is anonymous.
*
@@ -80,6 +84,27 @@ class Class_ extends ClassLike
/**
* @internal
*/
+ public static function verifyClassModifier($a, $b) {
+ if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) {
+ throw new Error('Multiple abstract modifiers are not allowed');
+ }
+
+ if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) {
+ throw new Error('Multiple final modifiers are not allowed');
+ }
+
+ if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) {
+ throw new Error('Multiple readonly modifiers are not allowed');
+ }
+
+ if ($a & 48 && $b & 48) {
+ throw new Error('Cannot use the final modifier on an abstract class');
+ }
+ }
+
+ /**
+ * @internal
+ */
public static function verifyModifier($a, $b) {
if ($a & self::VISIBILITY_MODIFIER_MASK && $b & self::VISIBILITY_MODIFIER_MASK) {
throw new Error('Multiple access type modifiers are not allowed');