Phly\Http\RequestTrait::validateMethod PHP 메소드

validateMethod() 개인적인 메소드

Validate the HTTP method
private validateMethod ( null | string $method )
$method null | string
    private function validateMethod($method)
    {
        if (null === $method) {
            return true;
        }
        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)));
        }
        $method = strtoupper($method);
        if (!in_array($method, $this->validMethods, true)) {
            throw new InvalidArgumentException(sprintf('Unsupported HTTP method "%s" provided', $method));
        }
    }