protected static function mergeMinMaxLength($length, $config)
    {
        if (array_key_exists('min', $config) || array_key_exists('max', $config)) {
            if (!array_key_exists('min', $length) && array_key_exists('min', $config)) {
                $length['min'] = $config['min'];
            }
            if (!array_key_exists('max', $length) && array_key_exists('max', $config)) {
                $length['max'] = $config['max'];
            }
        } else {
            if (!array_key_exists('min', $length)) {
                $length['min'] = reset($config);
            }
            if (!array_key_exists('max', $length)) {
                $length['max'] = end($config);
            }
        }
        return $length;
    }
protected static function mergeMinMaxLength($length, $config)
    {
        if (array_key_exists('min', $config) || array_key_exists('max', $config)) {
            if (!array_key_exists('min', $length) && array_key_exists('min', $config)) {
                $length['min'] = $config['min'];
            }
            if (!array_key_exists('max', $length) && array_key_exists('max', $config)) {
                $length['max'] = $config['max'];
            }
        } else {
            if (!array_key_exists('min', $length)) {
                $length['min'] = reset($config);
            }
            if (!array_key_exists('max', $length)) {
                $length['max'] = end($config);
            }
        }
        return $length;
    }
protected static function mergeMinMaxLength ( $ length , $ config ) { if ( array_key_exists ( 'min' , $ config ) || array_key_exists ( 'max' , $ config ) ) { if ( ! array_key_exists ( 'min' , $ length ) && array_key_exists ( 'min' , $ config ) ) { $ length [ 'min' ] = $ config [ 'min' ] ; } if ( ! array_key_exists ( 'max' , $ length ) && array_key_exists ( 'max' , $ config ) ) { $ length [ 'max' ] = $ config [ 'max' ] ; } } else { if ( ! array_key_exists ( 'min' , $ length ) ) { $ length [ 'min' ] = reset ( $ config ) ; } if ( ! array_key_exists ( 'max' , $ length ) ) { $ length [ 'max' ] = end ( $ config ) ; } } return $ length ; }
Adds the 'min' and 'max' fields from one array to the other

@param    array   Rule configuration, array with 'min' and 'max' keys
@param    array   Additional configuration, fields will be added to
$length if it doesn't contain such a key already
@return   array
Adds the min and max fields from one array to the other