original_string: public function withMethod($method)
      {
          $new = clone $this;
  
          if (!is_string($method) ||
              !preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)
          ) {
              throw new InvalidArgumentException(sprintf(
                  'Unsupported HTTP method "%s" provided',
                  $method
              ));
          }
          $new->_environment['REQUEST_METHOD'] = $method;
  
          return $new;
      }
code: public function withMethod($method)
      {
          $new = clone $this;
  
          if (!is_string($method) ||
              !preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)
          ) {
              throw new InvalidArgumentException(sprintf(
                  'Unsupported HTTP method "%s" provided',
                  $method
              ));
          }
          $new->_environment['REQUEST_METHOD'] = $method;
  
          return $new;
      }
code_tokens: public function withMethod ( $ method ) { $ new = clone $ this ; if ( ! is_string ( $ method ) || ! preg_match ( '/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i' , $ method ) ) { throw new InvalidArgumentException ( sprintf ( 'Unsupported HTTP method "%s" provided' , $ method ) ) ; } $ new -> _environment [ 'REQUEST_METHOD' ] = $ method ; return $ new ; }
docstring: Update the request method and get a new instance.
  
  @param string $method The HTTP method to use.
  @return static A new instance with the updated method.
  @link http://www.php-fig.org/psr/psr-7/ This method is part of the PSR-7 server request interface.
docstring_tokens: Update the request method and get a new instance .