= strtotime($endDate)) { throw new BadRequestException('course_offline.start_gt_end'); } } public function checkUserLimit($limit) { $value = $this->filter->sanitize($limit, ['trim', 'int']); if ($value < 1 || $value > 999) { throw new BadRequestException('course_offline.invalid_user_limit'); } return (int)$value; } public function checkLocation($location) { $value = $this->filter->sanitize($location, ['trim', 'string']); $length = kg_strlen($value); if ($length < 1 || $length > 50) { throw new BadRequestException('course_offline.invalid_location'); } return $value; } }