original_string: public static function addNonce($url, $action, $nonceParamName = 'nonce')
      {
          $fake = $url && strpos($url, '/') === 0;
  
          if ($fake) {
              $url = 'http://domain.com' . $url;
          }
          $uri = new static($url);
          $parts = $uri->toArray();
          $nonce = Utils::getNonce($action);
          $parts['params'] = ($parts['params'] ?? []) + [$nonceParamName => $nonce];
  
          if ($fake) {
              unset($parts['scheme'], $parts['host']);
          }
  
          return static::buildUrl($parts);
      }
code: public static function addNonce($url, $action, $nonceParamName = 'nonce')
      {
          $fake = $url && strpos($url, '/') === 0;
  
          if ($fake) {
              $url = 'http://domain.com' . $url;
          }
          $uri = new static($url);
          $parts = $uri->toArray();
          $nonce = Utils::getNonce($action);
          $parts['params'] = ($parts['params'] ?? []) + [$nonceParamName => $nonce];
  
          if ($fake) {
              unset($parts['scheme'], $parts['host']);
          }
  
          return static::buildUrl($parts);
      }
code_tokens: public static function addNonce ( $ url , $ action , $ nonceParamName = 'nonce' ) { $ fake = $ url && strpos ( $ url , '/' ) === 0 ; if ( $ fake ) { $ url = 'http://domain.com' . $ url ; } $ uri = new static ( $ url ) ; $ parts = $ uri -> toArray ( ) ; $ nonce = Utils :: getNonce ( $ action ) ; $ parts [ 'params' ] = ( $ parts [ 'params' ] ?? [ ] ) + [ $ nonceParamName => $ nonce ] ; if ( $ fake ) { unset ( $ parts [ 'scheme' ] , $ parts [ 'host' ] ) ; } return static :: buildUrl ( $ parts ) ; }
docstring: Adds the nonce to a URL for a specific action
  
  @param string $url            the url
  @param string $action         the action
  @param string $nonceParamName the param name to use
  
  @return string the url with the nonce
docstring_tokens: Adds the nonce to a URL for a specific action