carthage-software/mago
Mago is an extremely fast PHP linter, formatter, and static analyzer written in Rust. It brings Rust-inspired speed and reliability to PHP projects with a modern toolchain and great developer experience, plus multiple install options (script, Homebrew, Composer).
Mago is a comprehensive toolchain, not just a single utility. It's composed of several powerful, high-performance components that work together to improve your PHP code.
This section provides a detailed guide for each tool.
The formatter is an opinionated code formatter that ensures your entire codebase adheres to a single, consistent style based on PER-CS. It's designed to end debates over code style forever.
The linter is a blazing-fast tool for finding stylistic issues, inconsistencies, and code smells. It helps you maintain a clean and readable codebase with minimal effort.
The analyzer is a powerful static analysis engine that finds logical errors, type mismatches, and potential bugs in your code before you run it. It's the core of Mago's ability to ensure your code is correct and robust.
The architectural guard is a powerful architectural validation utility for enforcing boundaries and coding standards within a PHP project.
At the heart of Mago lies its high-performance Lexer and Parser. These components turn your raw PHP source code into a structured Abstract Syntax Tree (AST). The mago ast command provides a powerful way to inspect this structure for debugging and learning.
How can I help you explore Laravel packages today?