<commit_before><?hh

class DB {
  private static ?object $mysqli = null;

  public static function initialize() {
		$json = json_decode(file_get_contents('credentials.txt'), true);
    self::$mysqli = mysqli_connect(
      "localhost", 
      $json['user'], 
      $json['password'], 
      "<PASSWORD>",
    );
  }

  public static function query(string $queryString) {
    $query = mysqli_query(self::$mysqli, $queryString);
    $results = array();
    while ($row = $query->fetch_assoc()) {
      $results[] = $row;
    }
    $query->free();
    return $results;
  }

  public static function deinitialize() {
    self::$mysqli?->close();
  }

}<commit_msg>Error checking if credentials are missing.<commit_after><?hh

class DB {
  private static ?object $mysqli = null;

  public static function initialize() {
		$fileContents = file_get_contents('credentials.txt');
		if ($fileContents === false) {
			return;
		}
		$json = json_decode($fileContents, true);
    self::$mysqli = mysqli_connect(
      "localhost", 
      $json['user'], 
      $json['password'], 
      "<PASSWORD>",
    );
  }

  public static function query(string $queryString) {
    $query = mysqli_query(self::$mysqli, $queryString);
    $results = array();
    while ($row = $query->fetch_assoc()) {
      $results[] = $row;
    }
    $query->free();
    return $results;
  }

  public static function deinitialize() {
		if (self::$mysqli !== null) {
			self::$mysqli->close();
		}
  }

}
{'fraction_non_alphanumeric': 0.16734972677595628, 'fraction_numerical': 0.0, 'mean_word_length': 3.246376811594203, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3157239', 'n_tokens_mistral': 494, 'n_tokens_neox': 476, 'n_words': 102}