Beispiel #1
0
 protected function invoke($val)
 {
     $method = $this->ruleMethod;
     $rule = substr($method, strlen('rule_'));
     if ($this->isRuleArgumentSet === true) {
         return Vacuum::is($val, [$rule => $this->ruleArgument]);
     }
     return Vacuum::is($val, [$rule]);
 }
Beispiel #2
0
 public function test_invalidSignature2()
 {
     $flag = Vacuum::is('qwerty', 'string:76');
     $this->assertTrue($flag);
 }
Beispiel #3
0
 public function test_parseSyntax()
 {
     $this->assertTrue(Vacuum::is(19, 'req, min:  10  , max: 20  '));
     $this->assertTrue(Vacuum::is('qwe', 'req, in:[q, qw, qwe]'));
 }