src/Config/ConfigFinder.php
protected function mergeConfigs(array $old, array $new) : array
    {
      foreach ($new as $key => $val) {
        if (!array_key_exists($key, $old) || !is_array($old[$key]) || !is_array($val)) {
          $old[$key] = $val;
          continue;
        }

        if (is_int($key)) {
          $old[] = $val;
          continue;
        }

        $old[$key] = $this->mergeConfigs($old[$key], $val);
      }

      return $old;
    }
protected function mergeConfigs(array $old, array $new) : array
    {
      foreach ($new as $key => $val) {
        if (!array_key_exists($key, $old) || !is_array($old[$key]) || !is_array($val)) {
          $old[$key] = $val;
          continue;
        }

        if (is_int($key)) {
          $old[] = $val;
          continue;
        }

        $old[$key] = $this->mergeConfigs($old[$key], $val);
      }

      return $old;
    }
protected function mergeConfigs ( array $ old , array $ new ) : array { foreach ( $ new as $ key => $ val ) { if ( ! array_key_exists ( $ key , $ old ) || ! is_array ( $ old [ $ key ] ) || ! is_array ( $ val ) ) { $ old [ $ key ] = $ val ; continue ; } if ( is_int ( $ key ) ) { $ old [ ] = $ val ; continue ; } $ old [ $ key ] = $ this -> mergeConfigs ( $ old [ $ key ] , $ val ) ; } return $ old ; }
Recusively merges configs together

@param array $old
@param array $new
@return array
Recusively merges configs together