Exemplo n.º 1
0
 public function __construct(Bank $bank)
 {
     parent::__construct($bank);
     $this->mode1 = new Validator09($bank);
     $this->mode2 = new Validator06($bank);
     $this->mode2->setWeights(array(2, 3, 4, 5, 6, 7));
 }
Exemplo n.º 2
0
 protected function iterationStep()
 {
     if ($this->position <= 2 && ($this->account[3] == 5 || substr($this->account, 3, 2) == 69)) {
         return;
     }
     parent::iterationStep();
 }
Exemplo n.º 3
0
 public function __construct(Bank $bank)
 {
     parent::__construct($bank);
     $this->setWeights(array(2, 3, 4, 5));
     $this->setStart(-2);
     $this->setEnd(5);
 }
Exemplo n.º 4
0
 protected function init($account)
 {
     parent::init($account);
     if (substr($this->account, 0, 2) === '00') {
         $this->account = substr($this->account, 2) . '00';
     }
 }
Exemplo n.º 5
0
 public function __construct(Bank $bank)
 {
     parent::__construct($bank);
     $this->setWeights(array(2, 3, 4, 5, 6, 7));
     $this->setStart(-3);
     $this->setEnd(2);
     $this->setChecknumberPosition(-2);
 }
Exemplo n.º 6
0
 public function __construct(Bank $bank)
 {
     parent::__construct($bank);
     $this->setWeights(array(9, 10, 5, 8, 4, 2));
     $this->setStart(0);
     $this->setEnd(5);
     $this->setChecknumberPosition(6);
 }
Exemplo n.º 7
0
 public function __construct(Bank $bank)
 {
     parent::__construct($bank);
     $this->validator1 = new Validator06($bank);
     $this->validator1->setWeights(array(2, 3, 4, 5, 6, 7, 8, 0, 0));
     $this->validatorChain = new ValidatorChain($bank);
     $validator2 = new Validator06($bank);
     $validator2->setWeights(array(2, 3, 4, 5, 6, 7, 0, 0, 0));
     $this->validatorChain->addValidator($validator2);
     $validator3 = new Validator06($bank);
     $validator3->setWeights(array(2, 3, 4, 5, 6, 7, 0, 0, 0));
     $validator3->setDivisor(7);
     $this->validatorChain->addValidator($validator3);
     $validator4 = new Validator06($bank);
     $validator4->setWeights(array(2, 3, 4, 5, 6, 7, 0, 0, 0));
     $validator4->setDivisor(10);
     $this->validatorChain->addValidator($validator4);
 }
Exemplo n.º 8
0
 public function __construct(Bank $bank)
 {
     parent::__construct($bank);
     $this->setWeights(array(2, 3, 4, 5, 6, 7, 8, 9, 10));
 }
Exemplo n.º 9
0
 public function __construct(Bank $bank)
 {
     parent::__construct($bank);
     $this->setWeights(array(2, 4, 8, 5, 10, 9));
     $this->setEnd(3);
 }
Exemplo n.º 10
0
 protected function init($account)
 {
     parent::init($account);
     $this->setEnd($this->account[2] == 9 ? 2 : 3);
 }
Exemplo n.º 11
0
 public function isValid($account)
 {
     $length = strlen(ltrim($account, '0'));
     return ($length == 8 || $length == 9) && $this->validator10->isValid($account) || $length == 7 && parent::isValid($account);
 }
Exemplo n.º 12
0
 public function isValid($account)
 {
     return parent::isValid($account) || $this->isBetween(396000000, 499999999);
 }
Exemplo n.º 13
0
 protected function getResult()
 {
     return $this->accumulator % 11 === 1 ? $this->getChecknumber() === $this->account[$this->getNormalizedPosition($this->checknumberPosition) - 1] : parent::getResult();
 }
Exemplo n.º 14
0
 public function isValid($account)
 {
     return parent::isValid($account) || $this->isBetween(1, 1999999) || $this->isBetween(9000000, 25999999) || $this->isBetween(396000000, 499999999) || $this->isBetween(700000000, 799999999) || $this->isBetween(910000000, 989999999);
 }