Mago Is a Blazing Fast Linter, Formatter, And Static Analyzer for PHP, Written in Rust
Published on by Paul Redmond
Mago is a comprehensive PHP toolchain that helps developers write better code. Inspired by the Rust ecosystem, Mago brings speed, reliability, and an exceptional developer experience to PHP projects of all sizes.

Mago's toolchain includes a static analyzer, a configurable linter, an architectural guard, and a code formatter. Think of a tool that combines features found in PHPStan/Psalm, PHP-CS, PHP-CS-Fixer, php-parser, and more:
mago analyzemago lintmago formatmago guardmago ast
Each feature is highly configurable, and initializing Mago in your project is as easy as mago init. Mago can automatically configure your project based on the contents of composer.json.
Main Features
- Fast: Built in Rust for maximum performance.
- Lint: Identify issues in your codebase with customizable rules.
- Static Analysis: Perform deep analysis of your codebase to catch potential type errors and bugs.
- Automated Fixes: Apply fixes for many lint issues automatically.
- Formatting: Automatically format your code to adhere to best practices and style guides.
- Semantic Checks: Ensure code correctness with robust semantic analysis.
- AST Visualization: Explore your code’s structure with Abstract Syntax Tree (AST) parsing.
📕 Get started with Mago by following the project's getting started guide
💻 The source code is available on GitHub at carthage-software/mago