verifyModifier() public static method

public static verifyModifier ( $a, $b )
 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)];
 }
 /**
  * Sets a modifier in the $this->type property.
  *
  * @param int $modifier Modifier to set
  */
 protected function setModifier($modifier)
 {
     Stmt\Class_::verifyModifier($this->type, $modifier);
     $this->type |= $modifier;
 }
Example #3
0
 protected function checkModifier($a, $b, $modifierPos)
 {
     // Jumping through some hoops here because verifyModifier() is also used elsewhere
     try {
         Class_::verifyModifier($a, $b);
     } catch (Error $error) {
         $error->setAttributes($this->getAttributesAt($modifierPos));
         $this->emitError($error);
     }
 }
Example #4
0
 /**
  * validate if the modifier can be added to the current modifiers or not
  *
  * @param $modifier
  * @throws \EBT\ExtensionBuilder\Exception\FileNotFoundException
  * @throws \EBT\ExtensionBuilder\Exception\SyntaxErrorException
  */
 protected function validateModifier($modifier)
 {
     if ($modifier == \PhpParser\Node\Stmt\Class_::MODIFIER_FINAL && $this->isAbstract() || $modifier == \PhpParser\Node\Stmt\Class_::MODIFIER_ABSTRACT && $this->isFinal()) {
         throw new \EBT\ExtensionBuilder\Exception\SyntaxErrorException('Abstract and Final can\'t be applied both to same object');
     } elseif ($modifier == \PhpParser\Node\Stmt\Class_::MODIFIER_STATIC && $this->isAbstract() || $modifier == \PhpParser\Node\Stmt\Class_::MODIFIER_ABSTRACT && $this->isStatic()) {
         throw new \EBT\ExtensionBuilder\Exception\FileNotFoundException('Abstract and Static can\'t be applied both to same object');
     }
     try {
         \PhpParser\Node\Stmt\Class_::verifyModifier($this->modifiers, $modifier);
     } catch (\PhpParser\Error $e) {
         throw new \EBT\ExtensionBuilder\Exception\SyntaxErrorException('Only one access modifier can be applied to one object. Use setModifier to avoid this exception');
     }
 }
Example #5
0
 protected function reduceRule180($attributes)
 {
     Node\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)];
 }