Phlyty\Route::allowMethod PHP Method

allowMethod() public static method

Add an HTTP method you will allow
public static allowMethod ( string $method ) : void
$method string
return void
    public static function allowMethod($method)
    {
        $method = strtoupper($method);
        if (in_array($method, static::$allowedMethods)) {
            return;
        }
        static::$allowedMethods[] = $method;
    }

Usage Example

Example #1
0
 public function testCanSpecifyAdditionalMethodTypesToRespondTo()
 {
     Route::allowMethod(__FUNCTION__);
     $map = $this->app->map('/:controller', 'bogus-callback');
     $map->via(__FUNCTION__);
     $this->assertTrue($map->respondsTo(__FUNCTION__));
 }