Drest\DrestException::invalidHttpVerbUsed PHP Method

invalidHttpVerbUsed() public static method

public static invalidHttpVerbUsed ( string $verb ) : DrestException
$verb string
return DrestException
    public static function invalidHttpVerbUsed($verb)
    {
        return new self('Used an unknown HTTP verb of "' . $verb . '"');
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Add verbs that are to be allowed on this route.
  * @param  mixed          $verbs = a single or array of verbs valid for this route. eg array('GET', 'PUT')
  * @throws DrestException if verb is invalid
  */
 public function setVerbs($verbs)
 {
     $verbs = (array) $verbs;
     foreach ($verbs as $verb) {
         $verb = strtoupper($verb);
         if (!defined('DrestCommon\\Request\\Request::METHOD_' . $verb)) {
             throw DrestException::invalidHttpVerbUsed($verb);
         }
         $this->verbs[] = $verb;
     }
 }