Themosis\Validation\ValidationBuilder::validate_min PHP Method

validate_min() protected method

Validate a MIN length of string.
protected validate_min ( string $data, array $attributes = [] ) : string
$data string The string to evaluate.
$attributes array
return string
    protected function validate_min($data, array $attributes = [])
    {
        // If no length defined, return empty string.
        // @TODO Log the lack of a length...
        if (empty($attributes)) {
            return '';
        }
        $length = $attributes[0];
        $data = trim($data);
        if ($length <= strlen($data)) {
            return $data;
        }
        return '';
    }