This file contains important instructions for working on the phpdoc-parser project.
Tests are run using PHPUnit:
make testsOr directly:
php vendor/bin/phpunitPHPStan static analysis is run with:
make phpstanOr directly:
php vendor/bin/phpstanTo run all quality checks (lint, code style, tests, and PHPStan):
make checkThis runs:
lint- PHP syntax checking with parallel-lintcs- Code style checking with phpcstests- PHPUnit test suitephpstan- Static analysis
You MUST run both tests and PHPStan after every code change:
make tests && make phpstanOr use the comprehensive check:
make checkDO NOT commit or consider work complete until both tests and PHPStan pass successfully.
NEVER delete any tests. Tests are critical to the project's quality and regression prevention. If tests are failing:
- Fix the implementation to make tests pass
- Only modify tests if they contain actual bugs or if requirements have legitimately changed
- When in doubt, ask before modifying any test
make cs-fix- Automatically fix code style issuesmake lint- Check PHP syntax onlymake cs- Check code style onlymake phpstan-generate-baseline- Generate PHPStan baseline (use sparingly)
- Make code changes
- Run
make tests- ensure all tests pass - Run
make phpstan- ensure static analysis passes - Fix any issues found
- Commit only when both pass
- Repeat as needed
Remember: Tests and PHPStan MUST pass before any commit.