Skip to main content

Development Setup

This page covers working on Prune itself.

Prerequisites​

Clone and install​

git clone https://codeberg.org/renfordt/prune.git
cd prune
composer install

Running the tool from source​

php bin/prune src

Quality checks​

Prune ships with a full suite of quality tooling, wired up as Composer scripts.

Run everything​

composer test

This runs, in order: a Rector dry-run, a Pint style check, PHPStan, and PHPUnit.

Individual checks​

CommandWhat it does
composer test:unitPHPUnit test suite
composer test:typesPHPStan static analysis (level max)
composer test:lintPint code-style check (no changes)
composer test:refactoRector dry-run (no changes)

Auto-fixing​

CommandWhat it does
composer lintFix code style with Pint
composer refactoApply Rector refactorings

Running a single test​

vendor/bin/phpunit --filter=MethodName

Conventions​

  • declare(strict_types=1); in every PHP file (enforced by Pint, PSR-12 preset).
  • PHPStan runs at level max on src/.
  • Tests use the #[CoversClass], #[UsesClass], and #[Test] attributes; strict coverage metadata is enforced.
  • Test fixtures live in tests/Fixtures/.
  • Namespaces: Renfordt\Prune for src/, Renfordt\Prune\Tests for tests/.

Next​

See Architecture for a map of the codebase.