Skip to content

Remove orphaned /api/{stationCode}/analysis endpoint (HTTP 500) (#524)#550

Open
maltehuebner wants to merge 1 commit into
mainfrom
fix/analysis-endpoint-500-524
Open

Remove orphaned /api/{stationCode}/analysis endpoint (HTTP 500) (#524)#550
maltehuebner wants to merge 1 commit into
mainfrom
fix/analysis-endpoint-500-524

Conversation

@maltehuebner

Copy link
Copy Markdown
Contributor

Summary

AnalysisApiController::stationAnalysisAction called getRepository(Data::class)->findForAnalysis($station, 1). That method does not exist on DataRepository, and findForAnalysis is not a Doctrine magic finder (only findBy*/findOneBy*/findAll are auto-resolved), so every request threw BadMethodCallException -> HTTP 500.

Decision: remove, don't implement

On current main this endpoint is an orphan of the already-removed Analysis subsystem (AnalysisController and src/Air/Analysis/* are gone; the silvester_data materialized view it conceptually queried no longer exists). Implementing findForAnalysis would 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_routing export (the route wasn't exposed), and no test references it.

Changes

  • Deleted src/Controller/Api/AnalysisApiController.php.
  • Removed the api_station_analysis route from config/routing/2_api.yaml.
  • Removed the two related phpstan-baseline.neon entries (findForAnalysis, findOneByStationCode for 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 — no analysis route remains.
  • bin/console lint:container --env=prod — OK.

Closes #524

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Hoch] /api/{stationCode}/analysis wirft HTTP 500 (fehlende Repository-Methode)

1 participant