public static function validateRepeatingDays($repeatingDays) { if (!isset($repeatingDays)) { throw new Exception("At least one day is required."); } foreach ($repeatingDays as $repeatingDay) { if (!preg_match("/^[1-5]\$/", $repeatingDay)) { throw new Exception(ErrorMessages::getHacking()); } } }