<commit_before><?php

final class PhabricatorMailImplementationPHPMailerAdapter
  extends PhabricatorMailImplementationAdapter {

  const ADAPTERTYPE = 'smtp';

  private $mailer;

  protected function validateOptions(array $options) {
    PhutilTypeSpec::checkMap(
      $options,
      array(
        'host' => 'string|null',
        'port' => 'int',
        'user' => 'string|null',
        'password' => '<PASSWORD>',
        'protocol' => 'string|null',
        'encoding' => 'string',
        'mailer' => 'string',
      ));
  }

  public function newDefaultOptions() {
    return array(
      'host' => null,
      'port' => 25,
      'user' => null,
      'password' => <PASSWORD>,
      'protocol' => null,
      'encoding' => 'base64',
      'mailer' => 'smtp',
    );
  }

  public function newLegacyOptions() {
    return array(
      'host' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-host'),
      'port' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-port'),
      'user' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-user'),
      'password' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-<PASSWORD>'),
      'protocol' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-protocol'),
      'encoding' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding'),
      'mailer' => PhabricatorEnv::getEnvConfig('phpmailer.mailer'),
    );
  }

  /**
   * @phutil-external-symbol class PHPMailer
   */
  public function prepareForSend() {
    $root = phutil_get_library_root('phabricator');
    $root = dirname($root);<commit_msg>Fix PHPMailer/SMTP configuration typo for legacy SMTP configurations<commit_after><?php

final class PhabricatorMailImplementationPHPMailerAdapter
  extends PhabricatorMailImplementationAdapter {

  const ADAPTERTYPE = 'smtp';

  private $mailer;

  protected function validateOptions(array $options) {
    PhutilTypeSpec::checkMap(
      $options,
      array(
        'host' => 'string|null',
        'port' => 'int',
        'user' => 'string|null',
        'password' => '<PASSWORD>',
        'protocol' => 'string|null',
        'encoding' => 'string',
        'mailer' => 'string',
      ));
  }

  public function newDefaultOptions() {
    return array(
      'host' => null,
      'port' => 25,
      'user' => null,
      'password' => <PASSWORD>,
      'protocol' => null,
      'encoding' => 'base64',
      'mailer' => 'smtp',
    );
  }

  public function newLegacyOptions() {
    return array(
      'host' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-host'),
      'port' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-port'),
      'user' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-user'),
      'password' => <PASSWORD>('<PASSWORD>'),
      'protocol' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-protocol'),
      'encoding' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding'),
      'mailer' => PhabricatorEnv::getEnvConfig('phpmailer.mailer'),
    );
  }

  /**
   * @phutil-external-symbol class PHPMailer
   */
  public function prepareForSend() {
    $root = phutil_get_library_root('phabricator');
    $root = dirname($root);
{'fraction_non_alphanumeric': 0.1615285806037251, 'fraction_numerical': 0.002569043031470777, 'mean_word_length': 3.3444909344490936, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 52, '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': '6206312', 'n_tokens_mistral': 1042, 'n_tokens_neox': 1025, 'n_words': 166}