original_string: public static function delete_userkeys(string $script, $userid = null, $instance = null) {
          global $DB;
  
          $searchparams = [
              'script' => $script,
          ];
  
          if (null !== $userid) {
              $searchparams['userid'] = $userid;
          }
  
          if (null !== $instance) {
              $searchparams['instance'] = $instance;
          }
  
          $DB->delete_records('user_private_key', $searchparams);
      }
code: public static function delete_userkeys(string $script, $userid = null, $instance = null) {
          global $DB;
  
          $searchparams = [
              'script' => $script,
          ];
  
          if (null !== $userid) {
              $searchparams['userid'] = $userid;
          }
  
          if (null !== $instance) {
              $searchparams['instance'] = $instance;
          }
  
          $DB->delete_records('user_private_key', $searchparams);
      }
code_tokens: public static function delete_userkeys ( string $ script , $ userid = null , $ instance = null ) { global $ DB ; $ searchparams = [ 'script' => $ script , ] ; if ( null !== $ userid ) { $ searchparams [ 'userid' ] = $ userid ; } if ( null !== $ instance ) { $ searchparams [ 'instance' ] = $ instance ; } $ DB -> delete_records ( 'user_private_key' , $ searchparams ) ; }
docstring: Deletes all userkeys for a script.
  
  @param  string           $script The owner of the data (usually a component name).
  @param  int              $userid The owner of the data.
  @param  int              $instance The instance owner of the data.
docstring_tokens: Deletes all userkeys for a script .