[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/composer/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporters/ -> HitReporter.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of SwiftMailer.
   5   * (c) 2004-2009 Chris Corbyn
   6   *
   7   * For the full copyright and license information, please view the LICENSE
   8   * file that was distributed with this source code.
   9   */
  10  
  11  /**
  12   * A reporter which "collects" failures for the Reporter plugin.
  13   *
  14   * @author Chris Corbyn
  15   */
  16  class Swift_Plugins_Reporters_HitReporter implements Swift_Plugins_Reporter
  17  {
  18      /**
  19       * The list of failures.
  20       *
  21       * @var array
  22       */
  23      private $failures = [];
  24  
  25      private $failures_cache = [];
  26  
  27      /**
  28       * Notifies this ReportNotifier that $address failed or succeeded.
  29       *
  30       * @param string $address
  31       * @param int    $result  from {@link RESULT_PASS, RESULT_FAIL}
  32       */
  33      public function notify(Swift_Mime_SimpleMessage $message, $address, $result)
  34      {
  35          if (self::RESULT_FAIL == $result && !isset($this->failures_cache[$address])) {
  36              $this->failures[] = $address;
  37              $this->failures_cache[$address] = true;
  38          }
  39      }
  40  
  41      /**
  42       * Get an array of addresses for which delivery failed.
  43       *
  44       * @return array
  45       */
  46      public function getFailedRecipients()
  47      {
  48          return $this->failures;
  49      }
  50  
  51      /**
  52       * Clear the buffer (empty the list).
  53       */
  54      public function clear()
  55      {
  56          $this->failures = $this->failures_cache = [];
  57      }
  58  }


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1