original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Adds the min and max fields from one array to the other