function Modifiers::verifyModifier
@internal
3 calls to Modifiers::verifyModifier()
- BuilderHelpers::addModifier in vendor/
nikic/ php-parser/ lib/ PhpParser/ BuilderHelpers.php - Adds a modifier and returns new modifier bitmask.
- ParserAbstract::checkModifier in vendor/
nikic/ php-parser/ lib/ PhpParser/ ParserAbstract.php - ParserAbstract::checkPropertyHookModifiers in vendor/
nikic/ php-parser/ lib/ PhpParser/ ParserAbstract.php
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ Modifiers.php, line 68
Class
- Modifiers
- Modifiers used (as a bit mask) by various flags subnodes, for example on classes, functions, properties and constants.
Namespace
PhpParserCode
public static function verifyModifier(int $a, int $b) : void {
assert(self::isValidModifier($b));
if ($a & Modifiers::VISIBILITY_MASK && $b & Modifiers::VISIBILITY_MASK || $a & Modifiers::VISIBILITY_SET_MASK && $b & Modifiers::VISIBILITY_SET_MASK) {
throw new Error('Multiple access type modifiers are not allowed');
}
if (($a & $b) != 0) {
throw new Error('Multiple ' . self::toString($b) . ' modifiers are not allowed');
}
if ($a & 48 && $b & 48) {
throw new Error('Cannot use the final modifier on an abstract class member');
}
}