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]); }
public function test_invalidSignature2() { $flag = Vacuum::is('qwerty', 'string:76'); $this->assertTrue($flag); }
public function test_parseSyntax() { $this->assertTrue(Vacuum::is(19, 'req, min: 10 , max: 20 ')); $this->assertTrue(Vacuum::is('qwe', 'req, in:[q, qw, qwe]')); }