src/Charcoal/App/Route/RouteConfig.php
public function addMethod($method)
    {
        if (!is_string($method)) {
            throw new InvalidArgumentException(
                sprintf(
                    'Unsupported HTTP method; must be a string, received %s',
                    (is_object($method) ? get_class($method) : gettype($method))
                )
            );
        }

        // According to RFC, methods are defined in uppercase (See RFC 7231)
        $method = strtoupper($method);

        $validHttpMethods = [
            'CONNECT',
            'DELETE',
            'GET',
            'HEAD',
            'OPTIONS',
            'PATCH',
            'POST',
            'PUT',
            'TRACE',
        ];

        if (!in_array($method, $validHttpMethods)) {
            throw new InvalidArgumentException(sprintf(
                'Unsupported HTTP method; must be one of "%s", received "%s"',
                implode('","', $validHttpMethods),
                $method
            ));
        }

        $this->methods[] = $method;

        return $this;
    }
public function addMethod($method)
    {
        if (!is_string($method)) {
            throw new InvalidArgumentException(
                sprintf(
                    'Unsupported HTTP method; must be a string, received %s',
                    (is_object($method) ? get_class($method) : gettype($method))
                )
            );
        }

        // According to RFC, methods are defined in uppercase (See RFC 7231)
        $method = strtoupper($method);

        $validHttpMethods = [
            'CONNECT',
            'DELETE',
            'GET',
            'HEAD',
            'OPTIONS',
            'PATCH',
            'POST',
            'PUT',
            'TRACE',
        ];

        if (!in_array($method, $validHttpMethods)) {
            throw new InvalidArgumentException(sprintf(
                'Unsupported HTTP method; must be one of "%s", received "%s"',
                implode('","', $validHttpMethods),
                $method
            ));
        }

        $this->methods[] = $method;

        return $this;
    }
public function addMethod ( $ method ) { if ( ! is_string ( $ method ) ) { throw new InvalidArgumentException ( sprintf ( 'Unsupported HTTP method; must be a string, received %s' , ( is_object ( $ method ) ? get_class ( $ method ) : gettype ( $ method ) ) ) ) ; } // According to RFC, methods are defined in uppercase (See RFC 7231) $ method = strtoupper ( $ method ) ; $ validHttpMethods = [ 'CONNECT' , 'DELETE' , 'GET' , 'HEAD' , 'OPTIONS' , 'PATCH' , 'POST' , 'PUT' , 'TRACE' , ] ; if ( ! in_array ( $ method , $ validHttpMethods ) ) { throw new InvalidArgumentException ( sprintf ( 'Unsupported HTTP method; must be one of "%s", received "%s"' , implode ( '","' , $ validHttpMethods ) , $ method ) ) ; } $ this -> methods [ ] = $ method ; return $ this ; }
Add route HTTP method.

@param string $method The route's supported HTTP method.
@throws InvalidArgumentException If the HTTP method is invalid.
@return self
Add route HTTP method .