PHPackages                             miropen/mir-php - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. miropen/mir-php

ActiveComposer-plugin[Testing &amp; Quality](/categories/testing)

miropen/mir-php
===============

Fast static analyzer for PHP

v0.50.0(3w ago)631MITPHPPHP &gt;=8.1CI passing

Since Apr 26Pushed 1mo agoCompare

[ Source](https://github.com/jorgsowa/mir)[ Packagist](https://packagist.org/packages/miropen/mir-php)[ Docs](https://github.com/jorgsowa/mir)[ RSS](/packages/miropen-mir-php/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (4)Versions (50)Used By (0)

[![mir](site/src/assets/logo-hero.png)](site/src/assets/logo-hero.png)

mir
===

[](#mir)

[![Docs](https://camo.githubusercontent.com/4f12591d44e4e4f007bc99cc95fc7ec6fe87f0de6824af442c05afa62d248062/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d6a6f7267736f77612e6769746875622e696f2532466d69722d626c7565)](https://jorgsowa.github.io/mir/)

> ⚠️ **Experimental.** mir is under active development and not yet production-ready. APIs, CLI flags, issue codes, and output formats may change between releases; expect false positives and rough edges.

**[Try the Playground →](https://jorgsowa.github.io/mir/playground)**

A fast, incremental PHP static analyzer written in Rust, inspired by [Psalm](https://psalm.dev).

Features
--------

[](#features)

- **140+ diagnostic rules** across type errors, undefined symbols, dead code, taint, and more
- Sound type system — scalars, objects, generics, unions, intersections, literals, `never`, `void`
- Full type inference — return types, literal narrowing, `if`/`match`/`instanceof`/`is_string()` etc.
- Call checking — argument count and types for user-defined and built-in functions/methods
- Class analysis — inheritance, interface compliance, abstract enforcement, visibility, `readonly`, `final`
- Dead code detection — unused variables, parameters, private methods, properties, and functions
- Taint analysis — tracks data from `$_GET`/`$_POST` to HTML/SQL/shell sinks
- Incremental cache — unchanged files skipped on re-runs via content hashing
- Parallel analysis — rayon-powered; scales to available CPUs
- PHP 7.4–8.5 support with version-aware stub filtering
- Comprehensive built-in coverage — powered by [JetBrains phpstorm-stubs](https://github.com/JetBrains/phpstorm-stubs) (57 extensions, 500+ functions, 100+ classes)

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

[](#installation)

### From Composer (PHP projects)

[](#from-composer-php-projects)

```
composer require --dev miropen/mir-php
vendor/bin/mir src/
```

A `post-install-cmd` hook downloads the prebuilt binary matching your version and host platform from GitHub Releases. See the [getting started guide](https://jorgsowa.github.io/mir/guides/getting-started/)for supported targets.

### From crates.io

[](#from-cratesio)

```
cargo install mir-php
```

### Build from source

[](#build-from-source)

```
git clone https://github.com/jorgsowa/mir.git
cd mir
cargo build --release
# binary at target/release/mir
```

Usage
-----

[](#usage)

```
mir                        # analyze current directory
mir src/ lib/              # analyze specific paths
mir --format json src/     # machine-readable output
mir --baseline baseline.xml src/  # suppress known issues
```

See the [CLI reference](https://jorgsowa.github.io/mir/reference/cli/) for all flags and options.

### Suppressing issues inline

[](#suppressing-issues-inline)

Use `@mir-ignore`, `@mir-ignore-next-line`, or `@mir-ignore-file` to suppress a false positive directly in source. `@psalm-suppress` and `@phpstan-ignore-*`aliases are accepted. See the [suppression reference](https://jorgsowa.github.io/mir/reference/suppressions/).

Documentation
-------------

[](#documentation)

Full documentation is available at **[jorgsowa.github.io/mir](https://jorgsowa.github.io/mir/)**.

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

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md).

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance92

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.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 ~1 days

Total

49

Last Release

24d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/430780b0d4abfbc761d82d3defb705aeefcea09ec7b0c319ad843dcb0f048fcc?d=identicon)[Jorg Sowa](/maintainers/Jorg%20Sowa)

---

Top Contributors

[![jorgsowa](https://avatars.githubusercontent.com/u/74921107?v=4)](https://github.com/jorgsowa "jorgsowa (864 commits)")[![colinmollenhour](https://avatars.githubusercontent.com/u/38738?v=4)](https://github.com/colinmollenhour "colinmollenhour (1 commits)")

---

Tags

phpPHPStanstatic analysisanalyzerpsalm

### Embed Badge

![Health badge](/badges/miropen-mir-php/health.svg)

```
[![Health](https://phpackages.com/badges/miropen-mir-php/health.svg)](https://phpackages.com/packages/miropen-mir-php)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M9.2k](/packages/larastan-larastan)[phan/phan

A static analyzer for PHP

5.6k11.9M1.2k](/packages/phan-phan)[yamadashy/phpstan-friendly-formatter

Simple error formatter for PHPStan that display code frame

64861.2k47](/packages/yamadashy-phpstan-friendly-formatter)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

15118.7k4](/packages/calebdw-larastan)

PHPackages © 2026

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