private static function normalizeMaxLength($model, $attribute, &$options)
{
if (isset($options['maxlength']) && $options['maxlength'] === true) {
unset($options['maxlength']);
$attrName = static::getAttributeName($attribute);
foreach ($model->getActiveValidators($attrName) as $validator) {
if ($validator instanceof StringValidator && $validator->max !== null) {
$options['maxlength'] = $validator->max;
break;
}
}
}
}