/**
  * 
  * @param Route $annotation
  * @param ReflectionClass $class
  * @param ReflectionMethod $method
  * @throws InvalidArgumentException
  */
 public function handleMethodAnnotation(Route $annotation, array $classAnnotations, ReflectionClass $class, ReflectionMethod $method)
 {
     foreach ($classAnnotations as $classAnnotation) {
         if ($annotation->getExtends()) {
             throw new InvalidArgumentException('Not possible to define method-level "extends" property when at least one class-level @Route is defined.');
         }
     }
     $routeConfig = $this->annotationToRouteConfig($annotation, $class, $method);
     if (count($classAnnotations) > 0) {
         foreach ($classAnnotations as $classAnnotation) {
             $path = trim($classAnnotation->getExtends() . '/' . $classAnnotation->getName(), '/');
             $reference =& $this->getReferenceForPath(explode('/', $path), $this->config);
             $reference = ArrayUtils::merge($reference, $routeConfig);
             if (trim($classAnnotation->getRoute()) == '/') {
                 foreach ($reference as &$reference) {
                     $reference['options']['route'] = ltrim($reference['options']['route'], '/');
                 }
             }
         }
     } else {
         $this->config = ArrayUtils::merge($this->config, $routeConfig);
     }
 }