Remove orphaned /api/{stationCode}/analysis endpoint (HTTP 500) (#524)#550
Open
maltehuebner wants to merge 1 commit into
Open
Remove orphaned /api/{stationCode}/analysis endpoint (HTTP 500) (#524)#550maltehuebner wants to merge 1 commit into
maltehuebner wants to merge 1 commit into
Conversation
AnalysisApiController::stationAnalysisAction called $repository->findForAnalysis($station, 1), a method that does not exist on DataRepository and is not a Doctrine magic finder (only findBy*/findOneBy*/ findAll are resolved). Every call therefore threw a BadMethodCallException => HTTP 500. The endpoint is a leftover of the Analysis subsystem that was already removed on main (AnalysisController and src/Air/Analysis/* are gone, and the silvester_data materialized view it would have queried no longer exists). There is no in-repo consumer of the route (no template, JS route export, or test references it). Rather than fabricate an untestable findForAnalysis against a removed domain, the orphaned endpoint is removed: controller class, the api_station_analysis route, and the two related phpstan-baseline.neon entries. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AnalysisApiController::stationAnalysisActioncalledgetRepository(Data::class)->findForAnalysis($station, 1). That method does not exist onDataRepository, andfindForAnalysisis not a Doctrine magic finder (onlyfindBy*/findOneBy*/findAllare auto-resolved), so every request threwBadMethodCallException-> HTTP 500.Decision: remove, don't implement
On current
mainthis endpoint is an orphan of the already-removed Analysis subsystem (AnalysisControllerandsrc/Air/Analysis/*are gone; thesilvester_datamaterialized view it conceptually queried no longer exists). ImplementingfindForAnalysiswould mean inventing behaviour against a removed domain with no way to verify it. The issue explicitly offers removal as the alternative.Audit confirms the route has no in-repo consumer — no template, no
fos_js_routingexport (the route wasn'texposed), and no test references it.Changes
src/Controller/Api/AnalysisApiController.php.api_station_analysisroute fromconfig/routing/2_api.yaml.phpstan-baseline.neonentries (findForAnalysis,findOneByStationCodefor that controller).Verification
vendor/bin/phpstan analyse— No errors (baseline shrunk).vendor/bin/phpunit --testsuite="Project Test Suite"— 121 tests green.bin/console debug:router --env=prod— noanalysisroute remains.bin/console lint:container --env=prod— OK.Closes #524
🤖 Generated with Claude Code