Inheritance: implements isocodes\IsoCodeInterface
Exemplo n.º 1
0
 /**
  * @param string $value
  */
 private function __construct($value)
 {
     Guard::true(empty($value) || IbanValidator::validate($value), 'Must be a valid IBAN (ISO 13616:2007)');
     $this->value = $value;
 }
 private static function setContraAccount(&$entry, $values)
 {
     // match iban
     // only matches DE and AT iban's for now.
     $result = preg_match("/ [A-Z]{2}\\d{14,20} /", $values[1], $matches);
     if ($result === 1 && \IsoCodes\Iban::validate(trim($matches[0]))) {
         $entry->contraAccount = trim($matches[0]);
         return;
     }
     $date = new DateTime($entry->valueDate);
     if ($date->format('Y') < 2014) {
         $result = preg_match("/ \\d{11}/", $values[1], $matches);
         if ($result === 1) {
             $entry->contraAccount = trim($matches[0]);
             return;
         }
     }
     $entry->contraAccount = '';
 }
Exemplo n.º 3
0
 public function checkData()
 {
     $ibanValidator = \IsoCodes\Iban::validate($this->data);
     return $ibanValidator;
 }
Exemplo n.º 4
0
 /**
  * testInvalidIban
  *
  * @param string $iban
  *
  * @dataProvider getInvalidIbans
  *
  * @return void
  */
 public function testInvalidIban($iban)
 {
     $this->assertFalse(Iban::validate($iban));
 }