[ Index ]

MailPress 7.2

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

title

Body

[close]

/mp-includes/composer/vendor/egulias/email-validator/EmailValidator/Validation/ -> NoRFCWarningsValidation.php (source)

   1  <?php
   2  
   3  namespace Egulias\EmailValidator\Validation;
   4  
   5  use Egulias\EmailValidator\EmailLexer;
   6  use Egulias\EmailValidator\Exception\InvalidEmail;
   7  use Egulias\EmailValidator\Validation\Error\RFCWarnings;
   8  
   9  class NoRFCWarningsValidation extends RFCValidation
  10  {
  11      /**
  12       * @var InvalidEmail
  13       */
  14      private $error;
  15  
  16      /**
  17       * {@inheritdoc}
  18       */
  19      public function isValid($email, EmailLexer $emailLexer)
  20      {
  21          if (!parent::isValid($email, $emailLexer)) {
  22              return false;
  23          }
  24  
  25          if (empty($this->getWarnings())) {
  26              return true;
  27          }
  28  
  29          $this->error = new RFCWarnings();
  30  
  31          return false;
  32      }
  33  
  34      /**
  35       * {@inheritdoc}
  36       */
  37      public function getError()
  38      {
  39          return $this->error ?: parent::getError();
  40      }
  41  }


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