Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Modifiers.php

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

PhpParser

Code

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');
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal