protected function validateMinLength($value, string $parameter, array $args = [], array $rules = null, array $context = null): ?string
    {
        if (count($args) == 0) {
            throw new ValidatorConfigException('Validator \'minLength\' has to have defined minimum value');
        }

        if (!is_numeric($args[0])) {
            throw new ValidatorConfigException('Validator \'minLength\' has non-numeric value');
        }

        //$value = $this->getValue($parameter);

        $minLength = (int)$args[0];

        if ($minLength < 0) {
            throw new ValidatorConfigException('Validator \'minLength\' can not have negative minimum length');
        }

        if ($value === null) {
            return null;
        }

        if (!is_scalar($value)) {
            return Message::getMessage(Message::PRIMITIVE, [
                'param' => $parameter
            ]);
        }

        $value = trim((string)$value);

        if ($value === '') {
            return null;
        }

        if (mb_strlen($value, Application::getEncoding()) < $minLength) {
            return Message::getMessage(Message::MIN_LENGTH, [
                'param' => $parameter,
                'min' => $minLength,
                'value' => $value
            ]);
        }

        return null;
    }