@@ -186,23 +186,6 @@ public function run(?array $data = null, ?string $group = null, ?string $dbGroup
186
186
return $ this ->getErrors () === [];
187
187
}
188
188
189
- /**
190
- * Runs the validation process, returning true or false
191
- * determining whether validation was successful or not.
192
- *
193
- * @TODO the method signature is not good. Should make the checkValue()
194
- * method this method.
195
- *
196
- * @param array|bool|float|int|object|string|null $value
197
- * @param string[] $errors
198
- */
199
- public function check ($ value , string $ rule , array $ errors = []): bool
200
- {
201
- $ this ->reset ();
202
-
203
- return $ this ->setRule ('check ' , null , $ rule , $ errors )->run (['check ' => $ value ]);
204
- }
205
-
206
189
/**
207
190
* Runs the validation process, returning true or false determining whether
208
191
* validation was successful or not.
@@ -212,7 +195,7 @@ public function check($value, string $rule, array $errors = []): bool
212
195
* @param string[] $errors
213
196
* @param string|null $dbGroup The database group to use.
214
197
*/
215
- private function checkValue ($ value , $ rules , array $ errors = [], $ dbGroup = null ): bool
198
+ public function check ($ value , $ rules , array $ errors = [], $ dbGroup = null ): bool
216
199
{
217
200
$ this ->reset ();
218
201
@@ -732,7 +715,7 @@ protected function fillPlaceholders(array $rules, array $data): array
732
715
733
716
// Validate the placeholder field
734
717
$ dbGroup = $ data ['DBGroup ' ] ?? null ;
735
- if (! $ validator ->checkValue ($ data [$ field ], $ placeholderRules , [], $ dbGroup )) {
718
+ if (! $ validator ->check ($ data [$ field ], $ placeholderRules , [], $ dbGroup )) {
736
719
// if fails, do nothing
737
720
continue ;
738
721
}
0 commit comments