public function generateValidator() { $csrf = new ZendCsrf(); $csrf->setMessages(array(ZendCsrf::NOT_SAME => $this->getErrorMessage('NOT_SAME'))); $validatorChain = new ValidatorChain(); $validatorChain->addValidator($csrf); return $validatorChain; }
public function __construct(Bank $bank) { parent::__construct($bank); $this->validators[] = new Validator00($bank); $this->validators[0]->setWeights(array(2, 1)); $this->validators[] = new Validator03($bank); }
public function __construct(Bank $bank) { parent::__construct($bank); $this->validators[] = new Validator63($bank); $this->validators[] = new Validator06($bank); $this->validators[1]->setWeights(array(2, 3, 4, 5, 6, 7)); }
public function __construct(Bank $bank) { parent::__construct($bank); $this->validators[] = new Validator00($bank); $this->validators[] = new Validator04($bank); $this->validators[] = new Validator07($bank); }
/** * @throws ValidatorOutOfBoundsException * @param int $int */ protected function normalizeAccount($size) { parent::normalizeAccount($size); if (substr($this->account, 0, 4) !== '0000') { $this->account = '0000' . substr($this->account, 0, 6); } }
public function __construct(Bank $bank) { parent::__construct($bank); $this->validators[] = new Validator00($bank); $this->validators[0]->setWeights(array(2, 1)); $this->validators[] = new Validator10($bank); $this->validators[1]->setWeights(array(2, 3, 4, 5, 6, 7, 8, 9, 10)); }
public function __construct(Bank $bank) { parent::__construct($bank); $this->validators[] = new Validator52($bank); $this->validators[0]->setWeights(array(2, 4, 8, 5, 10, 9, 7, 3, 6, 1, 2, 4)); $this->validators[] = new Validator20($bank); $this->validators[1]->setWeights(array(2, 3, 4, 5, 6, 7, 8, 9, 3)); }
public function __construct(Bank $bank) { parent::__construct($bank); $this->validators[] = new Validator77a($bank); $this->validators[0]->setWeights(array(1, 2, 3, 4, 5)); $this->validators[] = new Validator77a($bank); $this->validators[1]->setWeights(array(5, 4, 3, 4, 5)); }
public function __construct(Bank $bank) { parent::__construct($bank); $this->validators[] = new Validator01($bank); $this->validators[0]->setWeights(array(3, 1, 7)); $this->validators[0]->setEnd(2); $this->validators[] = new Validator32($bank); }
public function __construct(Bank $bank) { parent::__construct($bank); $this->validators[] = new Validator05($bank); $this->validators[0]->setWeights(array(7, 3, 1)); $this->validators[] = new Validator01($bank); $this->validators[1]->setWeights(array(3, 7, 1)); }
public function __construct(Bank $bank) { parent::__construct($bank); $this->validators[] = new Validator20($bank); $this->validators[0]->setWeights(array(2, 3, 4, 5, 6, 7, 8, 9, 3)); $this->validators[] = new Validator29($bank); $this->validator9 = new Validator09($bank); $this->validators[] = $this->validator9; }
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); }
/** */ protected function init($account) { parent::init($account); if ($this->account[2] == 9) { $this->validators = $this->exceptionValidators; } else { $this->validators = $this->defaultValidators; } }
public function __construct(Bank $bank) { parent::__construct($bank); $this->validators[] = new Validator06($bank); $this->validators[0]->setWeights(array(2, 3, 4, 5, 6, 7, 0, 0, 0)); $this->validators[0]->setEnd(3); $this->validators[] = new ValidatorA4b($bank); $this->validators[] = new Validator06($bank); $this->validators[2]->setWeights(array(2, 3, 4, 5, 6, 0, 0, 0, 0)); $this->validators[2]->setEnd(4); $this->validators[] = new Validator93($bank); }
public function __construct(Bank $bank) { parent::__construct($bank); for ($i = 0; $i < 4; $i++) { $this->validators[] = new Validator06($bank); $this->validators[$i]->setChecknumberPosition(6); $this->validators[$i]->setStart(5); } $this->validators[0]->setWeights(array(2, 3, 4, 5, 6, 7)); $this->validators[1]->setWeights(array(7, 6, 5, 4, 3, 2)); $this->validators[2]->setWeights(array(2, 3, 4, 0, 5, 6, 7, 8, 9, 10)); $this->validators[3]->setWeights(array(2, 4, 8, 5, 10, 9)); $this->validators[2]->setStart(-1); }
public function buildChain() { $chain = new ValidatorChain(); $dateTimeValidator = new DateTimeValidator(); $notEmptyValidator = new NonEmptyValidator(); $integerValidator = new IntegerValidator(); $chain->addValidators('checkinDate', array($dateTimeValidator, $notEmptyValidator, new ActualDateTieValidator())); $chain->addValidators('checkoutDate', array($dateTimeValidator, $notEmptyValidator, new DateIntervalValidator('checkinDate', 'checkoutDate'))); $chain->addValidator('guestsCount', $integerValidator); $chain->addValidators('priceString', array($notEmptyValidator, new PriceValidator())); $chain->addRequiredFields(array('checkinDate', 'guestsCount', 'checkoutDate', 'priceString', 'pageId')); return $chain; }
protected function getResult() { switch (strlen($this->account)) { case 10: return $this->account[3] == 9 && $this->validator10->isValid($this->account); case 9: if ($this->account >= 400000000 && $this->account <= 499999999) { return false; } return parent::getResult(); case 6: case 7: case 8: return parent::getResult(); default: return false; } }
/** */ protected function init($account) { parent::init($account); $this->validators = $this->account[2] == 9 ? $this->exceptionValidators : $this->defaultValidators; }
/** */ protected function init($account) { parent::init($account); $this->validators = $this->account[2] == 9 ? array($this->modeF) : $this->defaultValidators; }
public function isValid($account) { return parent::isValid($account) || $this->isBetween(1300000, 99399999); }
public function isValid($account) { return $account >= 9300000000 && $account <= 9399999999 || parent::isValid($account); }
/** */ protected function init($account) { parent::init($account); $this->validators = substr($this->account, 2, 2) == 99 ? $this->exceptionValidators : $this->defaultValidators; }