From 60b535105af1b1a784b885677422655f8d60566d Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Sun, 9 Aug 2026 16:42:21 +0200 Subject: [PATCH] refactor(archimate): delete the unreachable private getVoorzieningenConfig duplicate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ArchiMateService::getVoorzieningenConfig()` is `private` and has zero `$this->` call sites in its own file — the only thing that can reach a private method. It is not reflected into either: the whole of `lib/` contains exactly one `ReflectionMethod` call site (`SettingsService:4644`) and it targets `getAmefConfig`, not this method. It cannot run. It is also a STALE duplicate. `SettingsService::getVoorzieningenConfig()` is the live resolver — 13 references across the app — and it ends with `normalizeVoorzieningenConfig()`, which this copy never had. Anything that had been wired to the copy would have received un-normalised config. Removing it removes three of gate-50's seventeen unsafe config reads (`voorzieningen_register`, `voorzieningen_organisatie_schema`, `voorzieningen_contactpersoon_schema`) by removing code that cannot execute, not by moving a guard into the checker's window. Can-fail proof: restoring the file from origin/development puts gate-50 back to 17; with the deletion it reports 14. phpcs clean, psalm clean, phpstan clean, phpmd clean against the repo baseline, unit suite 512 tests green. --- lib/Service/ArchiMateService.php | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/lib/Service/ArchiMateService.php b/lib/Service/ArchiMateService.php index 12620f78..f4c1590c 100644 --- a/lib/Service/ArchiMateService.php +++ b/lib/Service/ArchiMateService.php @@ -1694,36 +1694,6 @@ public function getAmefConfig(): array }//end try }//end getAmefConfig() - /** - * Get Voorzieningen configuration directly from IAppConfig - * - * @return array The voorzieningen configuration - */ - private function getVoorzieningenConfig(): array - { - $config = $this->config->getValueString('softwarecatalog', 'voorzieningen_config', '{}'); - $decoded = json_decode($config, true); - - if (is_array($decoded) === false) { - // Fallback to individual config values for backward compatibility. - $decoded = [ - 'register' => $this->config->getValueString('softwarecatalog', 'voorzieningen_register', ''), - 'organisatie_schema' => $this->config->getValueString( - 'softwarecatalog', - 'voorzieningen_organisatie_schema', - '' - ), - 'contactpersoon_schema' => $this->config->getValueString( - 'softwarecatalog', - 'voorzieningen_contactpersoon_schema', - '' - ), - ]; - } - - return $decoded; - }//end getVoorzieningenConfig() - /** * Get the current status of ArchiMate operations *