PHPackages                             carthage-software/mago - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. carthage-software/mago

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

carthage-software/mago
======================

Mago is a toolchain for PHP that aims to provide a set of tools to help developers write better code.

1.16.0(1mo ago)3.0k589.5k—8%142[98 issues](https://github.com/carthage-software/mago/issues)[24 PRs](https://github.com/carthage-software/mago/pulls)20MIT OR Apache-2.0RustPHP ~8.1 || ~8.2 || ~8.3 || ~8.4 || ~8.5 || ~8.6CI passing

Since Jan 24Pushed 1mo ago16 watchersCompare

[ Source](https://github.com/carthage-software/mago)[ Packagist](https://packagist.org/packages/carthage-software/mago)[ GitHub Sponsors](https://github.com/azjezz)[ RSS](/packages/carthage-software-mago/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (151)Used By (20)

 [![Mago Banner](docs/public/assets/banner.svg)](docs/public/assets/banner.svg)

**An extremely fast PHP linter, formatter, and static analyzer, written in Rust.**

[![CI Status](https://github.com/carthage-software/mago/actions/workflows/ci.yml/badge.svg)](https://github.com/carthage-software/mago/actions/workflows/ci.yml)[![CD Status](https://github.com/carthage-software/mago/actions/workflows/cd.yml/badge.svg)](https://github.com/carthage-software/mago/actions/workflows/cd.yml)[![CodeQL](https://github.com/carthage-software/mago/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/carthage-software/mago/actions/workflows/github-code-scanning/codeql)[![Crates.io](https://camo.githubusercontent.com/6e6a058d4fbb3cafef5cc9dccc6f4a931a604d94d8c8d91dd38a49ef38cb108f/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f762f6d61676f2e737667)](https://crates.io/crates/mago)[![Latest Stable Version for PHP](https://camo.githubusercontent.com/3be4bd2abadf8f4ba3eebbe1114cd3df589212bad4309a258cc9ceb694f9db16/68747470733a2f2f706f7365722e707567782e6f72672f63617274686167652d736f6674776172652f6d61676f2f76)](https://packagist.org/packages/carthage-software/mago)[![Total Composer Downloads](https://camo.githubusercontent.com/e07f8aa1c0c4d001a94396c24cd05113e0b64edbdb14557b60aa75394bd3d935/687474703a2f2f706f7365722e707567782e6f72672f63617274686167652d736f6674776172652f6d61676f2f646f776e6c6f616473)](https://packagist.org/packages/carthage-software/mago)[![License](https://camo.githubusercontent.com/fce1ec7093f91befefd76b199e8528451b1cd35ed4c631c6fb0f4a6650833e83/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f6c2f6d61676f2e737667)](https://github.com/carthage-software/mago/blob/main/LICENSE-MIT)

**Mago** is a comprehensive toolchain for PHP 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.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Getting Started](#getting-started)
- [Features](#features)
- [Our Sponsors](#our-sponsors)
- [Contributing](#contributing)
- [Inspiration &amp; Acknowledgements](#inspiration--acknowledgements)
- [License](#license)

Installation
------------

[](#installation)

The most common way to install Mago on macOS and Linux is by using our shell script:

```
curl --proto '=https' --tlsv1.2 -sSf https://carthage.software/mago.sh | bash
```

To install a specific version:

```
curl --proto '=https' --tlsv1.2 -sSf https://carthage.software/mago.sh | bash -s -- --version=1.18.1
```

For all other installation methods, including Homebrew, Composer, and Cargo, please refer to our official **[Installation Guide](https://mago.carthage.software/guide/installation)**.

Getting Started
---------------

[](#getting-started)

To get started with Mago and learn how to configure your project, please visit our **[Getting Started Guide](https://mago.carthage.software/guide/getting-started)** in the official documentation.

Features
--------

[](#features)

- ⚡️ Extremely 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.

Our Sponsors
------------

[](#our-sponsors)

[![JetBrains](https://avatars.githubusercontent.com/u/60931315?u=f9b545e50cace9e9028f77eaf1e83104d18d4d48&v=4&s=240)](https://www.jetbrains.com/ "JetBrains")[![zip-fa](https://avatars.githubusercontent.com/u/61551308?v=4&s=240)](https://github.com/zip-fa "zip-fa")

[![Jason R. McNeil](https://avatars.githubusercontent.com/u/39949?u=69c0e4fb08c439250978d41dbc3371d2f0609b98&v=4&s=160)](https://github.com/jasonrm "Jason R. McNeil")[![Vincent Berset](https://avatars.githubusercontent.com/u/5173120?u=95efc76cd8fc804536dc6dd25781a95b650bf902&v=4&s=160)](https://ofcompute.rs/ "Vincent Berset")

[![HeySora](https://avatars.githubusercontent.com/u/17962248?u=3cd88b4479a0dd018738612569d0954c81cdd25f&v=4&s=96)](https://heysora.net/ "HeySora")[![Bohuslav Šimek](https://avatars.githubusercontent.com/u/6493048?u=5eddf1eb923810745d8bdd62496d245238833d07&v=4&s=96)](https://github.com/kambo-1st "Bohuslav Šimek")[![TicketSwap](https://avatars.githubusercontent.com/u/5766233?v=4&s=96)](https://www.ticketswap.com "TicketSwap")

[See all sponsors](SPONSORS.md)

Contributing
------------

[](#contributing)

Mago is a community-driven project, and we welcome contributions! Whether you're reporting bugs, suggesting features, writing documentation, or submitting code, your help is valued.

- See our [Contributing Guide](./CONTRIBUTING.md) to get started.
- Join the discussion on [Discord](https://discord.gg/mwyyjr27eu).

Inspiration &amp; Acknowledgements
----------------------------------

[](#inspiration--acknowledgements)

Mago stands on the shoulders of giants. Our design and functionality are heavily inspired by pioneering tools in both the Rust and PHP ecosystems.

### Inspirations:

[](#inspirations)

- [Clippy](https://github.com/rust-lang/rust-clippy): For its comprehensive linting approach.
- [OXC](https://github.com/oxc-project/oxc/): A major inspiration for building a high-performance toolchain in Rust.
- [Hakana](https://github.com/slackhq/hakana/): For its deep static analysis capabilities.

### Acknowledgements:

[](#acknowledgements)

We deeply respect the foundational work of tools like [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer), [Psalm](https://github.com/vimeo/psalm), [PHPStan](https://github.com/phpstan/phpstan), and [PHP\_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer). While Mago aims to offer a unified and faster alternative, these tools paved the way for modern PHP development.

License
-------

[](#license)

Mago is dual-licensed under your choice of the following:

- MIT License ([LICENSE-MIT](./LICENSE-MIT))
- Apache License, Version 2.0 ([LICENSE-APACHE](./LICENSE-APACHE))

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance89

Actively maintained with recent releases

Popularity66

Solid adoption and visibility

Community50

Growing community involvement

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

139

Last Release

53d ago

Major Versions

0.26.1 → 1.0.0-alpha.12025-08-05

PHP version history (3 changes)0.4.0PHP ~8.3 || ~8.4

0.4.1PHP ~8.1 || ~8.2 || ~8.3 || ~8.4

1.0.0-rc.10PHP ~8.1 || ~8.2 || ~8.3 || ~8.4 || ~8.5 || ~8.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/8489d7c85bfa7c637b8e13484f3f659652aea0568b6e7f9e66edeb0649b5a2f1?d=identicon)[azjezz](/maintainers/azjezz)

---

Top Contributors

[![azjezz](https://avatars.githubusercontent.com/u/29315886?v=4)](https://github.com/azjezz "azjezz (2002 commits)")[![dotdash](https://avatars.githubusercontent.com/u/230962?v=4)](https://github.com/dotdash "dotdash (32 commits)")[![kzmshx](https://avatars.githubusercontent.com/u/50480499?v=4)](https://github.com/kzmshx "kzmshx (31 commits)")[![Bleksak](https://avatars.githubusercontent.com/u/5411554?v=4)](https://github.com/Bleksak "Bleksak (28 commits)")[![xHeaven](https://avatars.githubusercontent.com/u/14284867?v=4)](https://github.com/xHeaven "xHeaven (16 commits)")[![Zuruuh](https://avatars.githubusercontent.com/u/77583853?v=4)](https://github.com/Zuruuh "Zuruuh (8 commits)")[![veewee](https://avatars.githubusercontent.com/u/1618158?v=4)](https://github.com/veewee "veewee (8 commits)")[![npo-mmenke](https://avatars.githubusercontent.com/u/116382818?v=4)](https://github.com/npo-mmenke "npo-mmenke (7 commits)")[![edsrzf](https://avatars.githubusercontent.com/u/369904?v=4)](https://github.com/edsrzf "edsrzf (7 commits)")[![bendavies](https://avatars.githubusercontent.com/u/625392?v=4)](https://github.com/bendavies "bendavies (6 commits)")[![klausi](https://avatars.githubusercontent.com/u/213229?v=4)](https://github.com/klausi "klausi (6 commits)")[![chrisopperwall-qz](https://avatars.githubusercontent.com/u/76006879?v=4)](https://github.com/chrisopperwall-qz "chrisopperwall-qz (5 commits)")[![ostark](https://avatars.githubusercontent.com/u/1941743?v=4)](https://github.com/ostark "ostark (4 commits)")[![MidnightDesign](https://avatars.githubusercontent.com/u/743172?v=4)](https://github.com/MidnightDesign "MidnightDesign (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![innocenzi](https://avatars.githubusercontent.com/u/16060559?v=4)](https://github.com/innocenzi "innocenzi (4 commits)")[![z4nder](https://avatars.githubusercontent.com/u/39275291?v=4)](https://github.com/z4nder "z4nder (3 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (3 commits)")[![sasezaki](https://avatars.githubusercontent.com/u/42755?v=4)](https://github.com/sasezaki "sasezaki (3 commits)")[![ddanielou](https://avatars.githubusercontent.com/u/1174337?v=4)](https://github.com/ddanielou "ddanielou (2 commits)")

---

Tags

code-analyzercode-stylecoding-standardsformatterlexerlinterparserphpstatic-analysistype-checkerdev

### Embed Badge

![Health badge](/badges/carthage-software-mago/health.svg)

```
[![Health](https://phpackages.com/badges/carthage-software-mago/health.svg)](https://phpackages.com/packages/carthage-software-mago)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[meyfa/php-svg

Read, edit, write, and render SVG files with PHP

54613.9M42](/packages/meyfa-php-svg)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
