Zend\Diactoros\ServerRequest::withMethod PHP Méthode

withMethod() public méthode

Unlike the regular Request implementation, the server-side normalizes the method to uppercase to ensure consistency and make checking the method simpler. This methods returns a new instance.
public withMethod ( string $method ) : self
$method string
Résultat self
    public function withMethod($method)
    {
        $this->validateMethod($method);
        $new = clone $this;
        $new->method = $method;
        return $new;
    }