Thank you for your interest in contributing to php-lean.
- PHP 8.2+ — the project supports PHP 8.2 through 8.6.
- Composer — for dependency management and development commands.
After cloning the repository, follow these steps to set up the project:
git clone git@github.com:lean-packages/php-lean.git && cd php-lean
composer installVerify the setup. Run all checks to confirm everything works:
composer pre-commit-checkThis project uses Composer scripts to manage common development commands.
See all available scripts with:
composer runRun tests, formatting, static analysis, dependency analysis, spell checking, and version alignment in one command:
composer pre-commit-checkCheck formatting (enforced in CI):
composer cs-lintAuto-fix formatting issues:
composer cs-fixCheck for type errors and code issues via PHPStan:
composer static-analyseFind shadowed or unused dependencies:
composer dependency-analyseValidate the .gitattributes export-ignore list against the current repository state:
composer validate-gitattributesCheck for spelling errors:
composer spell-checkRun the full test suite:
composer testRun tests with code coverage:
composer test-with-coveragePlease open pull requests against the main branch from a dedicated feature branch. Use descriptive branch names that
reflect the change, such as:
feat/lint-commandfix/export-ignore-orderdocs/update-readme
Before opening a PR, ensure:
composer pre-commit-checkpasses locally (tests, lint, static analysis, dependency analysis, spell check, and version alignment).CHANGELOG.mdis updated under the[Unreleased]section with a summary of changes.- All commit messages follow Conventional Commits.
Please follow Conventional Commits for all commit messages. This keeps the history readable
and enables automated changelog generation. You can inspect the message schema for this project via git log --oneline -n 10.
Common types used in this project:
feat:— new features or behavior changesfix:— bug fixesdocs:— documentation updatesrefactor:— code changes that neither fix bugs nor add featurestest:— adding or updating testschore:— maintenance tasks (dependencies, config, etc.)