shipfastlabs / pun
Pun formats, lints, and analyses PHP 8.3+ projects in one Rust binary. Downloads the native binary on first run.
Requires
- php: >=8.3
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-25 12:04:09 UTC
README
Introduction
Pun is one native binary for projects that target PHP 8.3 or later. It formats, lints, and analyses your code, and installs your Composer packages from composer.json and composer.lock. Its own settings live in one pun.toml. It formats code byte for byte like Laravel Pint, and pun migrate converts your existing Pint, PHP-CS-Fixer, Rector, and PHPStan configs.
Install the binary on Linux or macOS (x86_64 or arm64):
curl -fsSL https://punphp.com/install | sh
Or add it to a project with Composer:
composer require --dev shipfastlabs/pun
vendor/bin/pun migrate # or: vendor/bin/pun init
vendor/bin/pun check --fix
Official Documentation
The documentation is on the Pun website.
Contributing
Thank you for considering contributing to Pun! AGENTS.md explains how to build Pun (Rust 1.100 or later), which checks to run, and which upstream tools Pun is tested against. If Pun is missing a rule you rely on, open an issue or send a pull request.
Security Vulnerabilities
To report a security vulnerability, follow our security policy.
Credits
Pun would not be possible without Mago, PHP-CS-Fixer, Laravel Pint, PHPStan, Larastan, Rector and Composer. Pun uses Mago's parser and analysis libraries directly and ports behavior, rules and test fixtures from these projects. Thank you to everyone behind them.
License
Pun is open-sourced software licensed under the MIT license. The licenses of ported code are in licenses/THIRD_PARTY_NOTICES.md, and those of the bundled Rust crates in licenses/THIRD_PARTY_LICENSES.md.
