Пример #1
0
 public function __construct(Bank $bank)
 {
     parent::__construct($bank);
     $this->mode1 = new Validator00($bank);
     $this->mode1->setWeights(array(2, 1));
     $this->mode2 = new Validator01($bank);
     $this->mode2->setWeights(array(3, 7, 1));
 }
Пример #2
0
 /**
  * @return bool
  */
 protected function getResult()
 {
     if ($this->account[0] != 0) {
         return $this->validator->isValid($this->account);
     }
     $set = (int) substr($this->account, 0, 3);
     return $set >= 1 && $set <= 9;
 }
Пример #3
0
 protected function validate()
 {
     if (in_array($this->account[0], [6, 7, 8, 9])) {
         $this->result = false;
         return;
     }
     $validator = new Validator00($this->bank);
     $validator->doNormalization = false;
     $prefixedAccount = self::$prefixes[$this->account[0]] . substr($this->account, 1);
     $this->result = $validator->isValid($prefixedAccount);
 }
Пример #4
0
 public function __construct(Bank $bank)
 {
     parent::__construct($bank);
     $this->validator09 = new Validator09($bank);
     $this->mode1 = new Validator00($bank);
     $this->mode1->setWeights(array(1, 2));
     $this->mode1->setStart(0);
     $this->mode1->setEnd(-2);
     $this->mode2 = new Validator00($bank);
     $this->mode2->setWeights(array(1, 2, 0, 1, 2, 1, 2, 1, 2, 1));
     $this->mode2->setChecknumberPosition(2);
     $this->mode2->setStart(0);
     $this->mode2->setEnd(-1);
     $this->modeMap = array(51 => 1, 55 => 1, 61 => 1, 64 => 1, 65 => 1, 66 => 1, 70 => 1, 88 => 1, 94 => 1, 95 => 1, 52 => 2, 53 => 2, 54 => 2, 62 => 2, 63 => 2, 67 => 2, 68 => 2, 69 => 2, 71 => 2, 72 => 2, 89 => 2, 90 => 2, 92 => 2, 93 => 2, 96 => 2, 97 => 2, 98 => 2, 40 => 3, 50 => 3, 91 => 3, 99 => 3);
 }
Пример #5
0
 public function __construct(Bank $bank)
 {
     parent::__construct($bank);
     $this->setWeights(array(2, 0, 0, 0, 0, 1, 2, 1, 2));
     $this->setStart(0);
     $this->setEnd(-2);
 }
Пример #6
0
 public function __construct(Bank $bank)
 {
     parent::__construct($bank);
     $this->setWeights(array(2, 1));
     $this->setStart(-4);
     $this->setChecknumberPosition(-3);
 }
Пример #7
0
 /**
  * @param string $account
  * @return bool
  */
 public function isValid($account)
 {
     if (parent::isValid($account)) {
         return true;
     }
     $account = ltrim($account, '0') . '00';
     return strlen($account) <= $this->normalizedSize && parent::isValid($account);
 }
Пример #8
0
 protected function init($account)
 {
     parent::init($account);
     if ($this->account[8] == 9) {
         $this->setEnd(-1);
     } else {
         $this->setEnd(6);
     }
 }
Пример #9
0
 protected function init($account)
 {
     parent::init($account);
     if ($this->account[3] == 9) {
         $this->setEnd(3);
     } else {
         $this->setEnd(0);
     }
 }
Пример #10
0
 public function isValid($account)
 {
     // 8-stellige Kontonummern sind nicht prüfbar
     $trimedAccount = ltrim($account, "0");
     if (strlen($trimedAccount) === 8) {
         return true;
     }
     return parent::isValid($account);
 }
Пример #11
0
 protected function getResult()
 {
     /*
      * Es ist jedoch zu beachten, dass Kontonummern, die
      * kleiner als 9-stellig sind,[…] als richtig behandelt werden. 
      */
     $trimedAccount = ltrim($this->account, "0");
     if (strlen($trimedAccount) < 9) {
         return !empty($trimedAccount) && true;
     }
     return parent::getResult();
 }
Пример #12
0
 protected function getResult()
 {
     if (parent::getResult()) {
         return true;
     } elseif (strlen(ltrim($this->account, '0')) == 6) {
         $nextHalfDecade = round($this->accumulator / 10) * 10 + 5;
         $check = ($nextHalfDecade - $this->accumulator) % 10;
         return (string) $check === $this->getChecknumber();
     } else {
         return false;
     }
 }
Пример #13
0
 public function isValid($account)
 {
     $this->checkType($account);
     $account = ltrim($account, '0');
     $length = strlen($account);
     if ($length < 6 || $length > 9) {
         return false;
     }
     if ($length == 9) {
         if ($account[0] == 9) {
             $account = substr($account, 1, 6);
         } else {
             $account = substr($account, 0, 6);
         }
     }
     return parent::isValid($account);
 }
Пример #14
0
 public function __construct(Bank $bank)
 {
     parent::__construct($bank);
     $this->setWeights(array(2, 1));
     $this->setEnd(3);
 }
Пример #15
0
 /**
  * @return bool
  */
 protected function getResult()
 {
     return $this->account[0] != 0 && $this->validator->isValid($this->transformedAccount);
 }
Пример #16
0
 /**
  * @return bool
  */
 protected function getResult()
 {
     return in_array($this->account[0], array_keys(self::$transformation)) ? $this->validator->isValid($this->transformedAccount) : false;
 }
Пример #17
0
 /**
  * @return bool
  */
 protected function getResult()
 {
     return array_key_exists($this->getTransformationIndex(), self::$transformation) && $this->validator->isValid($this->transformedAccount);
 }
Пример #18
0
 protected function validate()
 {
     parent::validate();
     $this->accumulator += 7;
 }
Пример #19
0
 /**
  * @return bool
  */
 protected function getResult()
 {
     return $this->account[0] === '0' || $this->account[4] === '1' || parent::getResult();
 }
Пример #20
0
 /**
  * @return bool
  */
 protected function getResult()
 {
     return !is_null($this->validator) && $this->validator->isValid($this->account);
 }
Пример #21
0
 protected function getResult()
 {
     return (int) $this->account < 60000 ? true : parent::getResult();
 }
Пример #22
0
 /**
  * @param string $account
  * @return bool
  */
 public function isValid($account)
 {
     return (int) $account <= 999999999 ? $this->validator00->isValid($account) : parent::isValid($account);
 }