<commit_before><?php

final class PhabricatorGDSetupCheck extends PhabricatorSetupCheck {

  public function getDefaultGroup() {
    return self::GROUP_OTHER;
  }

  protected function executeChecks() {
    if (!extension_loaded('gd')) {
      $message = pht(
        "The '%s' extension is not installed. Without '%s', support, ".
        "Phabricator will not be able to process or resize images ".
        "(for example, to generate thumbnails). Install or enable '%s'.",
        'gd',
        'gd',
        'gd');

      $this->newIssue('extension.gd')
        ->setName(pht("Missing '%s' Extension", 'gd'))
        ->setMessage($message);
    } else {
      $image_type_map = array(
        'imagecreatefrompng'  => 'PNG',
        'imagecreatefromgif'  => 'GIF',
        'imagecreatefromjpeg' => 'JPEG',
      );

      $have = array();
      foreach ($image_type_map as $function => $image_type) {
        if (function_exists($function)) {
          $have[] = $image_type;<commit_msg>Include extension name for GDSetupCheck.<commit_after><?php

final class PhabricatorGDSetupCheck extends PhabricatorSetupCheck {

  public function getDefaultGroup() {
    return self::GROUP_OTHER;
  }

  protected function executeChecks() {
    if (!extension_loaded('gd')) {
      $message = pht(
        "The '%s' extension is not installed. Without '%s', support, ".
        "Phabricator will not be able to process or resize images ".
        "(for example, to generate thumbnails). Install or enable '%s'.",
        'gd',
        'gd',
        'gd');

      $this->newIssue('extension.gd')
        ->setName(pht("Missing '%s' Extension", 'gd'))
        ->setMessage($message)
        ->addPHPExtension('gd');
    } else {
      $image_type_map = array(
        'imagecreatefrompng'  => 'PNG',
        'imagecreatefromgif'  => 'GIF',
        'imagecreatefromjpeg' => 'JPEG',
      );

      $have = array();
      foreach ($image_type_map as $function => $image_type) {
        if (function_exists($function)) {
          $have[] = $image_type;
{'fraction_non_alphanumeric': 0.14467876410004904, 'fraction_numerical': 0.0, 'mean_word_length': 2.6690647482014387, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, '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': '3224512', 'n_tokens_mistral': 620, 'n_tokens_neox': 604, 'n_words': 154}