The method Between does not exist on object<TheSupportGroup\C...alidator\Rules\Between>? Since you implemented __call, maybe consider adding a @method annotation.
If you implement __call and you know which methods are available, you
can improve IDE auto-completion and static analysis by adding a @method annotation to
the class.
This is often the case, when __call is implemented by a parent class and
only the child class knows which methods exist:
classParentClass{private$data=array();publicfunction__call($method,array$args){if(0===strpos($method,'get')){return$this->data[strtolower(substr($method,3))];}thrownew\LogicException(sprintf('Unsupported method: %s',$method));}}/** * If this class knows which fields exist, you can specify the methods here: * * @method string getName() */classSomeClassextendsParentClass{}
Loading history...
36
trim($values[0]), // min
37
trim($values[1]), // max
38
true // inclusive
39
);
40
41
if ($this->hasRule('numeric') !== false) {
42
$this->isNumeric = true;
43
44
return $between->validate($input);
45
}
46
47
$input = mb_strlen($input);
48
49
return $between->validate($input);
50
}
51
52
/**
53
* Returns error message from rule.
54
*
55
* @return string
56
*/
57
public function getMessage()
58
{
59
if ($this->isNumeric) {
60
return 'Field :field: should be between in :param: values';
61
}
62
63
return 'Field :field: length should be between :param: characters';
This check marks private properties in classes that are never used. Those properties can be removed.