1 | <?php |
||
23 | class Validate extends Validator |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * The regex engine |
||
28 | * |
||
29 | * @var \mithra62\Regex |
||
30 | */ |
||
31 | protected $regex = null; |
||
32 | |||
33 | /** |
||
34 | * Overrides the initial validation constructor |
||
35 | * |
||
36 | * @throws \InvalidArgumentException |
||
37 | */ |
||
38 | public function __construct() |
||
54 | |||
55 | /** |
||
56 | * Adds all the custom rules |
||
57 | * |
||
58 | * @throws ValidateException |
||
59 | */ |
||
60 | protected function loadRules() |
||
89 | |||
90 | /** |
||
91 | * Processes the validation group |
||
92 | * |
||
93 | * @param array $data |
||
94 | * @return \Valitron\boolean |
||
95 | */ |
||
96 | public function val(array $data) |
||
108 | |||
109 | /** |
||
110 | * Checks if there are errors and returns a boolean |
||
111 | * |
||
112 | * @return boolean |
||
113 | */ |
||
114 | public function hasErrors() |
||
122 | |||
123 | /** |
||
124 | * Returns the error messages |
||
125 | * |
||
126 | * @return Ambigous <\Valitron\array, \Valitron\bool> |
||
127 | */ |
||
128 | public function getErrorMessages() |
||
132 | |||
133 | /** |
||
134 | * Returns an array of all the custom rules |
||
135 | * |
||
136 | * @return array |
||
137 | */ |
||
138 | public function getCustomRules() |
||
142 | |||
143 | /** |
||
144 | * Sets the regular expression engine |
||
145 | * |
||
146 | * @param \mithra62\Regex $regex |
||
147 | * @return \mithra62\Validate |
||
148 | */ |
||
149 | public function setRegex(\JaegerApp\Regex $regex) |
||
154 | |||
155 | public function getRegex() |
||
159 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: