Development Setup
This page covers working on Prune itself.
Prerequisites
- PHP 8.4+
- Composer
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
| Command | What it does |
|---|---|
composer test:unit | PHPUnit test suite |
composer test:types | PHPStan static analysis (level max) |
composer test:lint | Pint code-style check (no changes) |
composer test:refacto | Rector dry-run (no changes) |
Auto-fixing
| Command | What it does |
|---|---|
composer lint | Fix code style with Pint |
composer refacto | Apply 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\Pruneforsrc/,Renfordt\Prune\Testsfortests/.
Next
See Architecture for a map of the codebase.