1: <?php
2: 3: 4: 5: 6: 7:
8:
9: namespace Wei\Validator;
10:
11: 12: 13: 14: 15:
16: class NoneOf extends SomeOf
17: {
18: protected $invalidMessage = '%name% must be passed by all of these rules';
19:
20: protected $combineMessages = false;
21:
22: 23: 24: 25:
26: public function __invoke($input, array $rules = array(), $__ = null)
27: {
28: $rules && $this->storeOption('rules', $rules);
29:
30: return $this->isValid($input);
31: }
32:
33: 34: 35:
36: protected function doValidate($input)
37: {
38: $this->addError('invalid');
39:
40: $validator = null;
41: $props = array(
42: 'name' => $this->name,
43: 'negative' => true
44: );
45: foreach ($this->rules as $rule => $options) {
46: if (!$this->validate->validateOne($rule, $input, $options, $validator, $props)) {
47: $this->validators[$rule] = $validator;
48: }
49: }
50:
51: if (!$this->validators) {
52: $this->errors = array();
53: return true;
54: } else {
55: return false;
56: }
57: }
58: }
59: