PhpParser\Node\Stmt\Class_::verifyModifier PHP Method

verifyModifier() public static method

public static verifyModifier ( $a, $b )
    public static function verifyModifier($a, $b)
    {
        if ($a & self::VISIBILITY_MODIFER_MASK && $b & self::VISIBILITY_MODIFER_MASK) {
            throw new Error('Multiple access type modifiers are not allowed');
        }
        if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) {
            throw new Error('Multiple abstract modifiers are not allowed');
        }
        if ($a & self::MODIFIER_STATIC && $b & self::MODIFIER_STATIC) {
            throw new Error('Multiple static modifiers are not allowed');
        }
        if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) {
            throw new Error('Multiple final modifiers are not allowed');
        }
        if ($a & 48 && $b & 48) {
            throw new Error('Cannot use the final modifier on an abstract class member');
        }
    }

Usage Example

コード例 #1
0
 protected function reduceRule176()
 {
     Stmt\Class_::verifyModifier($this->semStack[$this->stackPos - (2 - 1)], $this->semStack[$this->stackPos - (2 - 2)]);
     $this->semValue = $this->semStack[$this->stackPos - (2 - 1)] | $this->semStack[$this->stackPos - (2 - 2)];
 }
All Usage Examples Of PhpParser\Node\Stmt\Class_::verifyModifier