mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-25 23:58:39 +00:00
Make sure foreach is traversable
This commit is contained in:
parent
b41fdb7deb
commit
2770bb0d37
|
|
@ -39,6 +39,10 @@ final class Validator extends ValidatorAbstract
|
|||
*/
|
||||
public static function isValid($var, array $constraints = null) : bool
|
||||
{
|
||||
if(!isset($constraints)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($constraints as $callback => $settings) {
|
||||
$callback = StringUtils::endsWith($callback, 'Not') ? substr($callback, 0, -3) : $callback;
|
||||
$valid = self::$callback($var, ...$settings);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user