original_string: public function addMethod($method)
      {
          // Capitalise method
          $method = strtoupper($method);
  
          if (!in_array($method, self::$availableMethods)) {
              throw new InvalidArgumentException(sprintf('Invalid method for route with path "%s". Method must be one of: ' . implode(', ', self::$availableMethods) . '. Got "%s" instead.', $this->getPath(), $method));
          }
  
          if (!in_array($method, $this->methods)) {
              $this->methods[] = $method;
          }
  
          // Add HEAD method if GET has been allowed for this Route
          if ($method == 'GET') {
              $this->addMethod('HEAD');
          }
  
          return $this;
      }
code: public function addMethod($method)
      {
          // Capitalise method
          $method = strtoupper($method);
  
          if (!in_array($method, self::$availableMethods)) {
              throw new InvalidArgumentException(sprintf('Invalid method for route with path "%s". Method must be one of: ' . implode(', ', self::$availableMethods) . '. Got "%s" instead.', $this->getPath(), $method));
          }
  
          if (!in_array($method, $this->methods)) {
              $this->methods[] = $method;
          }
  
          // Add HEAD method if GET has been allowed for this Route
          if ($method == 'GET') {
              $this->addMethod('HEAD');
          }
  
          return $this;
      }
code_tokens: public function addMethod ( $ method ) { // Capitalise method $ method = strtoupper ( $ method ) ; if ( ! in_array ( $ method , self :: $ availableMethods ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid method for route with path "%s". Method must be one of: ' . implode ( ', ' , self :: $ availableMethods ) . '. Got "%s" instead.' , $ this -> getPath ( ) , $ method ) ) ; } if ( ! in_array ( $ method , $ this -> methods ) ) { $ this -> methods [ ] = $ method ; } // Add HEAD method if GET has been allowed for this Route if ( $ method == 'GET' ) { $ this -> addMethod ( 'HEAD' ) ; } return $ this ; }
docstring: Adds method to array of methods accepted by Route
  
  @param   string  $method     Name of HTTP method to add
  @return  Route
  @throws  InvalidArgumentException
docstring_tokens: Adds method to array of methods accepted by Route