Пример #1
0
 /**
  * Get reflection class.
  * @param ReflectionAnnotatedClass|ReflectionAnnotatedProperty|ReflectionAnnotatedMethod $reflection Reflection
  * @return ReflectionAnnotatedClass
  * @throws Exception
  */
 public static function getReflectionClass($reflection)
 {
     if (null === $reflection) {
         throw new Exception(sprintf('No reflection class for matcher `%s`', get_class($this)));
     }
     if ($reflection instanceof ReflectionAnnotatedMethod) {
         return $reflection->getDeclaringClass();
     }
     if ($reflection instanceof ReflectionAnnotatedProperty) {
         return $reflection->getDeclaringClass();
     }
     return $reflection;
 }