protected function validateMethod($method)
    {
        if ($method === null) {
            return $method;
        }

        if (!is_string($method)) {
            throw new \InvalidArgumentException('Method should be a string.');
        }

        $method = strtoupper($method);

        if (!in_array($method, $this->allowMethods)) {
            throw new \InvalidArgumentException('Invalid HTTP method: ' . $method);
        }

        return $method;
    }
protected function validateMethod($method)
    {
        if ($method === null) {
            return $method;
        }

        if (!is_string($method)) {
            throw new \InvalidArgumentException('Method should be a string.');
        }

        $method = strtoupper($method);

        if (!in_array($method, $this->allowMethods)) {
            throw new \InvalidArgumentException('Invalid HTTP method: ' . $method);
        }

        return $method;
    }
protected function validateMethod ( $ method ) { if ( $ method === null ) { return $ method ; } if ( ! is_string ( $ method ) ) { throw new \ InvalidArgumentException ( 'Method should be a string.' ) ; } $ method = strtoupper ( $ method ) ; if ( ! in_array ( $ method , $ this -> allowMethods ) ) { throw new \ InvalidArgumentException ( 'Invalid HTTP method: ' . $ method ) ; } return $ method ; }
Validate method name.

@param   string $method Method to validate.

@return  string  Valid or not.
Validate method name .