hasMethod() public static method

Checks whether specified method is accepted for the request
public static hasMethod ( string $method ) : boolean
$method string HTTP Method
return boolean Returns TRUE if the specified method is accepted for the request
Example #1
0
 /**
  * Add allowed method for the route
  *
  * @param    string     $method   The HTTP method
  * @return   Route      Returns current route instance
  */
 public function addMethod($method)
 {
     if (!Request::hasMethod($method)) {
         throw new \InvalidArgumentException(sprintf("HTTP method '%s' is not accepted for the Request.", $method));
     }
     $this->defaults['methods'] = array_merge($this->defaults['methods'], [$method]);
     return $this;
 }