Example #1
0
 private function handleAnnotation(ReflectionMethod $reflMethod, $instance)
 {
     $annotation = $reflMethod->getAnnotation(AccessControl::class);
     $role = self::getRole();
     if (!$this->acl->isAllowed($role, $annotation->value)) {
         throw new UnAuthorizedException();
     }
 }
 /**
  * @covers PhSpring\Reflection\ReflectionMethod::getAnnotation
  */
 public function testGetAnnotation()
 {
     $annotation = $this->object->getAnnotation(Qualifier::class);
     $this->assertInstanceOf(Qualifier::class, $annotation);
 }