original_string: public
      static function mergeSettings(
          $generalSettings,
          $environmentSettings
      ) {
          $mergedSettings = $generalSettings;
  
          foreach ($environmentSettings as $key => &$value) {
              if (
                  is_array($value)
                  && isset($mergedSettings[$key])
                  && is_array($mergedSettings [$key])
              ) {
                  $mergedSettings[$key] = self::mergeSettings($mergedSettings[$key], $value);
              } else {
                  $mergedSettings[$key] = $value;
              }
          }
  
          return $mergedSettings;
      }
code: public
      static function mergeSettings(
          $generalSettings,
          $environmentSettings
      ) {
          $mergedSettings = $generalSettings;
  
          foreach ($environmentSettings as $key => &$value) {
              if (
                  is_array($value)
                  && isset($mergedSettings[$key])
                  && is_array($mergedSettings [$key])
              ) {
                  $mergedSettings[$key] = self::mergeSettings($mergedSettings[$key], $value);
              } else {
                  $mergedSettings[$key] = $value;
              }
          }
  
          return $mergedSettings;
      }
code_tokens: public static function mergeSettings ( $ generalSettings , $ environmentSettings ) { $ mergedSettings = $ generalSettings ; foreach ( $ environmentSettings as $ key => & $ value ) { if ( is_array ( $ value ) && isset ( $ mergedSettings [ $ key ] ) && is_array ( $ mergedSettings [ $ key ] ) ) { $ mergedSettings [ $ key ] = self :: mergeSettings ( $ mergedSettings [ $ key ] , $ value ) ; } else { $ mergedSettings [ $ key ] = $ value ; } } return $ mergedSettings ; }
docstring: Merges two arrays, just like array_merge_recursive, but the second array
  overwrites the first one's values if there is a match.
  
  @param array $generalSettings the base array
  @param array $environmentSettings the overwriting array
  @return array the merged settings.
docstring_tokens: Merges two arrays just like array_merge_recursive but the second array overwrites the first one s values if there is a match .