public function validateNumericSetting($settings, $name, $property = null, $minValue = 0)
{
if (is_null($property)) {
$property = $this->getSettingsRules()[$name];
}
if (!isset($settings[$name])) {
throw new ApiErrorException(400, ErrorMessage::ERR_INVALID_STRUCTURE, sprintf('Missed property %s', $property));
}
if (!is_numeric($settings[$name])) {
throw new ApiErrorException(400, ErrorMessage::ERR_INVALID_VALUE, sprintf('Unexpected %s value', $property));
}
if ($settings[$name] < $minValue) {
throw new ApiErrorException(400, ErrorMessage::ERR_INVALID_VALUE, sprintf('Property %s must be greater than or equal to %u', $property, $minValue));
}
}