Drest\DrestException::handleAnnotationDoesntMatchRouteName PHP Method

handleAnnotationDoesntMatchRouteName() public static method

public static handleAnnotationDoesntMatchRouteName ( string $name ) : DrestException
$name string
return DrestException
    public static function handleAnnotationDoesntMatchRouteName($name)
    {
        return new self('The configured handle "' . $name . '" doesn\'t match any route of that name. ' . 'Ensure @Drest\\Handle(for="my_route") matches @Drest\\Route(name="my_route")');
    }

Usage Example

Example #1
0
 /**
  * Process the method
  * @param $resource
  * @param Mapping\ClassMetaData $metadata
  * @throws DrestException
  */
 protected function processMethods($resource, Mapping\ClassMetaData $metadata)
 {
     /* @var \ReflectionMethod $method */
     foreach ($resource['routes'] as $route) {
         // Make sure the for is not empty
         if (!isset($route['name']) || !is_string($route['name'])) {
             throw DrestException::handleForCannotBeEmpty();
         }
         if (($routeMetaData = $metadata->getRouteMetaData($route['name'])) === false) {
             throw DrestException::handleAnnotationDoesntMatchRouteName($route['name']);
         }
         if ($routeMetaData->hasHandleCall()) {
             // There is already a handle set for this route
             throw DrestException::handleAlreadyDefinedForRoute($routeMetaData);
         }
         // Set the handle
         if (isset($route['handle_call'])) {
             $routeMetaData->setHandleCall($route['handle_call']);
         }
     }
 }
All Usage Examples Of Drest\DrestException::handleAnnotationDoesntMatchRouteName