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.42.0(6d ago)3.3k1.2M↑56.6%165[67 issues](https://github.com/carthage-software/mago/issues)[18 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 2d ago18 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 yesterday

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

 [![Mago Banner](docs/static/img/banner.svg)](docs/static/img/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)[![CodSpeed](https://camo.githubusercontent.com/06a66eaab8d0af3b50301152f7ac162f6eacdafda054e858b2182fdc82e64d6e/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f636f6473706565642e696f2f62616467652e6a736f6e)](https://codspeed.io/carthage-software/mago?utm_source=badge)[![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.42.0
```

For all other installation methods, including Homebrew, Composer, and Cargo, please refer to our official **[Installation Guide](https://mago.carthage.software/latest/en/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/latest/en/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")

[![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")

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

[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

76

—

ExcellentBetter than 100% of packages

Maintenance99

Actively maintained with recent releases

Popularity69

Solid adoption and visibility

Community54

Growing community involvement

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 88.5% 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

165

Last Release

6d 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 (2529 commits)")[![dotdash](https://avatars.githubusercontent.com/u/230962?v=4)](https://github.com/dotdash "dotdash (68 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (45 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 (30 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 (14 commits)")[![edsrzf](https://avatars.githubusercontent.com/u/369904?v=4)](https://github.com/edsrzf "edsrzf (14 commits)")[![Soean](https://avatars.githubusercontent.com/u/695201?v=4)](https://github.com/Soean "Soean (9 commits)")[![veewee](https://avatars.githubusercontent.com/u/1618158?v=4)](https://github.com/veewee "veewee (8 commits)")[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (7 commits)")[![npo-mmenke](https://avatars.githubusercontent.com/u/116382818?v=4)](https://github.com/npo-mmenke "npo-mmenke (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)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![psihius](https://avatars.githubusercontent.com/u/3097957?v=4)](https://github.com/psihius "psihius (6 commits)")[![ostark](https://avatars.githubusercontent.com/u/1941743?v=4)](https://github.com/ostark "ostark (5 commits)")[![chrisopperwall-qz](https://avatars.githubusercontent.com/u/76006879?v=4)](https://github.com/chrisopperwall-qz "chrisopperwall-qz (5 commits)")[![MidnightDesign](https://avatars.githubusercontent.com/u/743172?v=4)](https://github.com/MidnightDesign "MidnightDesign (4 commits)")[![innocenzi](https://avatars.githubusercontent.com/u/16060559?v=4)](https://github.com/innocenzi "innocenzi (4 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

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[tivie/php-git-log-parser

A parser for logs generated by git log

1857.8k](/packages/tivie-php-git-log-parser)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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