Skip to content

Tools Overview

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.


Formatter

The Formatter is an opinionated code formatter that ensures your entire codebase adheres to a single, consistent style based on PSR-12. It's designed to end debates over code style forever.


Linter

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.


Analyzer

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.


Lexer & Parser

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.