Skip to content

Installation and usage

phil/dev-tools

In a package or a monorepo root

composer require --dev phil/dev-tools
vendor/bin/phil-dev init
composer update
composer deps:normalize:fix
composer hooks

init writes the thin configuration files at the root and adds the Composer scripts, the bin plugin and the development dependencies to composer.json. A directory that holds packages/ is set up as a monorepo root; --package and --monorepo choose explicitly. Nothing that exists with other content is replaced unless --force is given, and phil-dev.php is never replaced. Commands describes every option.

composer update then installs the quality tools, each in its own vendor-bin/<tool>/ through bamarni/composer-bin-plugin, so that their dependencies never meet the project's. composer deps:normalize:fix sorts the scripts init added, and composer hooks installs the git hooks of captainhook.json.

Every day

ScriptWhat it runs
composer gatesEvery gate in order: dependency analysis, advisories, unused packages, normalized composer.json, code style of PHP, Twig and scripts, PHPStan, Rector, Deptrac, Arkitect, PHPUnit, Infection.
composer cs:fix, rector:fix, twig:fix, js:fix, deps:normalize:fixThe fixes of PHP-CS-Fixer, Rector, Twig-CS-Fixer, Biome and composer-normalize.
composer infection:changedMutation testing of the files changed since the base ref, once per batch before its commit.
composer packagesEach package of a monorepo installed and tested on its own.
composer docsThe documentation checks of each package.
composer test:next, packages:next, infection:nextThe same on the next PHP of the version matrix.
composer test:servicesThe Integration suite against the real servers.

Before a release, and once a week

ScriptWhat it runs
composer taint, fuzz, sbomThe taint analysis, the fuzz targets and the bill of materials: see Security checks.
composer bcThe public API against the latest tag, in a package's own repository.
composer twigstanThe Twig templates analysed by TwigStan.
composer bench:baseline, bench:compare, bench:workerThe benchmarks: see Benchmarks.
composer docs:lint, hotspots, splitThe prose, the hotspots and the split: see The monorepo workflow.

A new package

vendor/bin/phil-dev new phil/example
vendor/bin/phil-dev new tilttek/example --bundle

The package skeleton describes what is written.

Requirements

PHP 8.5 or later, and Docker for the real servers and the next PHP of the matrix.