Drest\DrestException::handleForCannotBeEmpty PHP Method

handleForCannotBeEmpty() public static method

public static handleForCannotBeEmpty ( )
    public static function handleForCannotBeEmpty()
    {
        return new self('The @Drest\\Handle configuration MUST contain a valid / matching "for" value');
    }

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::handleForCannotBeEmpty