Remove redundant code

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

The code in the foreach and `getExtensionConfig` were exactly the same. The `array_merge` merges `$this->extensionConfigs[$name]` and `$this->extensionConfigs[$name]`, so nothing to merge...