Skip to content

Remove dead code and stale configuration (#540)#554

Open
maltehuebner wants to merge 1 commit into
mainfrom
cleanup/altlasten-540
Open

Remove dead code and stale configuration (#540)#554
maltehuebner wants to merge 1 commit into
mainfrom
cleanup/altlasten-540

Conversation

@maltehuebner

Copy link
Copy Markdown
Contributor

Removes the belegten dead code and orphaned configuration from #540. The Provider subsystem was already removed on main in #507, so that task is done.

Changes

Dead PHP (grep-verified: zero usages)

  • src/Air/ImportCache/{ImportCache,ImportCacheInterface}.php
  • src/Air/Util/ClassUtil.php, src/Air/Util/StringUtil.php
  • src/Twig/Extension/CronTwigExtension.php — references Cron\CronExpression, but dragonmantank/cron-expression is not installed and the cron() Twig function is called in no template (first use would fatal)
  • dropped the unused use App\Entity\Zip; import in RequestConverter (the Zip entity does not exist)

Stale configuration

  • config/services.yaml: removed the unused locale parameter, the consumer-less $graphCacheDirectory bind (plus GRAPH_CACHE_DIRECTORY in .env/.env.test), and the dead alias targeting the non-existent App\Air\Pollution\DataPersister namespace. The live persister interface (App\Air\DataPersister\PersisterInterface) is the one actually injected; the old FQCN is referenced in zero use statements, so the alias was inert (Symfony drops unused private aliases).
  • deleted config/packages/dev/easy_log_handler.yaml (registers EasyCorp\EasyLog\EasyLogHandler; the package is not installed and abandoned since 2020)
  • removed the controller-less logout route from config/routing/4_frontend.yaml (there is no security firewall, and the route name is referenced nowhere)
  • removed /phpunit.xml from .gitignore (the file is git-tracked and consumed directly by CI — the ignore line was a foot-gun)
  • fixed the KohlemnonooxidKohlenmonoxid keyword typo in sonata_seo.yaml

Docs

  • CLAUDE.md / README.md: corrected the search description — the app has no Elasticsearch integration (zero references in composer.json/src/); search/autocomplete is client-side @algolia/autocomplete-js + Nominatim geocoding, not "Elasticsearch"/"Typeahead/Bloodhound".

Notes / deferred

  • The elasticsearch service still present in docker-compose.yml (and docker/elasticsearch/) is a legacy remnant; removing the infra service/volume is out of scope for this docs+dead-code cleanup and is noted inline in CLAUDE.md.
  • The locale-parameter vs translation.yaml default_locale: en inconsistency is resolved by removing the unused locale parameter.

Verification

  • vendor/bin/phpstan analyse --no-progress — No errors
  • vendor/bin/phpunit --testsuite="Project Test Suite" — OK (121 tests)
  • All three edited YAML files parse cleanly (Symfony\Component\Yaml\Yaml::parseFile).
  • Limitation: the container could not be booted here (local vendor/ lacks symfony/runtime), so the services/routing changes were verified by grep (no references to the removed ids/params/route anywhere) + YAML lint rather than a full container compile.

Refs #540 (Provider-subsystem item already done in #507)

🤖 Generated with Claude Code

Dead PHP (grep-verified zero usages):
- src/Air/ImportCache/{ImportCache,ImportCacheInterface}.php
- src/Air/Util/ClassUtil.php and StringUtil.php
- src/Twig/Extension/CronTwigExtension.php (uses Cron\CronExpression,
  but dragonmantank/cron-expression is not installed; the cron() Twig
  function is called in no template)
- dropped the unused `use App\Entity\Zip;` import in RequestConverter
  (the Zip entity does not exist)

Stale configuration:
- config/services.yaml: removed the unused `locale` parameter, the
  consumer-less `$graphCacheDirectory` bind (+ GRAPH_CACHE_DIRECTORY in
  .env/.env.test), and the dead alias for the non-existent
  App\Air\Pollution\DataPersister namespace (the live persister lives in
  App\Air\DataPersister and that FQCN is referenced nowhere).
- deleted config/packages/dev/easy_log_handler.yaml (registers
  EasyCorp\EasyLog\EasyLogHandler; package not installed, abandoned)
- removed the controller-less `logout` route from
  config/routing/4_frontend.yaml (no security firewall, route name
  referenced nowhere)
- removed the `/phpunit.xml` line from .gitignore (the file is tracked
  and consumed by CI directly)
- fixed the "Kohlemnonooxid" -> "Kohlenmonoxid" keyword typo in
  sonata_seo.yaml

Docs:
- CLAUDE.md / README: corrected the search description (client-side
  @algolia/autocomplete-js + Nominatim, not Elasticsearch/Bloodhound);
  the Provider subsystem was already removed on main in #507.

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.

1 participant