original_string: public static function checkNonce($nonceName, $nonce = null)
      {
          if ($nonce === null) {
              $nonce = Common::getRequestVar('nonce', null, 'string');
          }
  
          if (!self::verifyNonce($nonceName, $nonce)) {
              throw new \Exception(Piwik::translate('General_ExceptionNonceMismatch'));
          }
  
          self::discardNonce($nonceName);
      }
code: public static function checkNonce($nonceName, $nonce = null)
      {
          if ($nonce === null) {
              $nonce = Common::getRequestVar('nonce', null, 'string');
          }
  
          if (!self::verifyNonce($nonceName, $nonce)) {
              throw new \Exception(Piwik::translate('General_ExceptionNonceMismatch'));
          }
  
          self::discardNonce($nonceName);
      }
code_tokens: public static function checkNonce ( $ nonceName , $ nonce = null ) { if ( $ nonce === null ) { $ nonce = Common :: getRequestVar ( 'nonce' , null , 'string' ) ; } if ( ! self :: verifyNonce ( $ nonceName , $ nonce ) ) { throw new \ Exception ( Piwik :: translate ( 'General_ExceptionNonceMismatch' ) ) ; } self :: discardNonce ( $ nonceName ) ; }
docstring: Verifies and discards a nonce.
  
  @param string $nonceName The nonce's unique ID. See {@link getNonce()}.
  @param string|null $nonce The nonce from the client. If `null`, the value from the
  **nonce** query parameter is used.
  @throws \Exception if the nonce is invalid. See {@link verifyNonce()}.
docstring_tokens: Verifies and discards a nonce .