AGENTS.md
Fifteen-year-old PHP order management system. Many parts have no tests. Production depends on it daily.
Commands
- Run tests:
vendor/bin/phpunit(covers about a third of the code) - Static analysis (baseline enforced):
vendor/bin/phpstan analyse - Local stack:
docker compose upthen http://localhost:8080
How to change code here
- Before changing untested code, add a characterization test that records current behavior (see
tests/Characterization/for examples). - Make the smallest change that solves the task. No drive-by refactors; list cleanup ideas in your summary instead.
- Keep the old public function signatures; many are called from templates and cron scripts. Search
templates/andcron/too. - New code goes in
src/(namespaced, typed, tested). Legacy code inlib/may call new code, not the other way round.
Known traps
lib/db.phpreturnsfalseon query errors instead of throwing. Check return values.- Prices are stored as strings with two decimals in some tables and as integer cents in others; check the column type.
- Times in
ordersare server local time (Europe/Berlin), not UTC.