<commit_before><?php
class ApplicationDebug {

  private static $_debug = false;

  public static function init($debug) {
    self::$_debug = $debug;
  }

  /*
  throw new Exception("OMG!");

  or

  ApplicationDebug::exception(new Exception("EXCEPTION!"));
  */

  public static function exception($exception) {
    self::_render($exception->getMessage(), $exception->getFile(), $exception->getLine(), $exception->getTrace());
  }


  /*
  echo $a;

  or

  ApplicationDebug::error(123123, "Undefined variable: a", "/var/www/html/app/controllers/DefaultController.php", 10);
  */

  public static function error($errno, $message, $file, $line) {
    self::_render($message, $file, $line, debug_backtrace());
  }

  /*
  public function index() {}
  public function index() {}
  // Cannot redeclare HomeController::index()

  */

  public static function shutdown() {
    $error = error_get_last();
    if ($error) {
      ApplicationLogger::fatal("Sistem çalışmasını engelleyecek yanılgı → " . $error["message"]);
      self::error($error["type"], $error["message"], $error["file"], $error["line"]);
    }
  }

  private static function _render($message, $file, $line, $traces) {
    $header = $message;<commit_msg>Update ApplicationDebug.php<commit_after><?php
class ApplicationDebug {

  private static $_debug = false;

  public static function init($debug) {
    self::$_debug = $debug;
  }

  /*
  throw new Exception("OMG!");

  or

  ApplicationDebug::exception(new Exception("EXCEPTION!"));
  */

  public static function exception($exception) {
    self::_render($exception->getMessage(), $exception->getFile(), $exception->getLine(), $exception->getTrace());
  }

  /*
  echo $a;

  or

  ApplicationDebug::error(123123, "Undefined variable: a", "/var/www/html/app/controllers/DefaultController.php", 10);
  */

  public static function error($errno, $message, $file, $line) {
    self::_render($message, $file, $line, debug_backtrace());
  }

  /*
  public function index() {}
  public function index() {}
  // Cannot redeclare HomeController::index()
  */

  public static function shutdown() {
    $error = error_get_last();
    if ($error) {
      ApplicationLogger::fatal("Sistem çalışmasını engelleyecek yanılgı → " . $error["message"]);
      self::error($error["type"], $error["message"], $error["file"], $error["line"]);
    }
  }

  private static function _render($message, $file, $line, $traces) {
    $header = $message;
{'fraction_non_alphanumeric': 0.17307692307692307, 'fraction_numerical': 0.006546644844517185, 'mean_word_length': 4.21321961620469, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '888494', 'n_tokens_mistral': 791, 'n_tokens_neox': 739, 'n_words': 168}