Thanks to visit codestin.com
Credit goes to lib.rs

#mir #php #issue #static #analyzer #type-system

mir-issues

Issue definitions and reporting for the mir PHP static analyzer

41 releases (26 breaking)

new 0.28.0 May 17, 2026
0.26.0 May 15, 2026

#255 in FFI

Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

301 downloads per month
Used in 5 crates (4 directly)

MIT license

135KB
3K SLoC

mir

mir

Docs

⚠️ 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 →

A fast, incremental PHP static analyzer written in Rust, inspired by Psalm.

Features

  • 77 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 SHA-256 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 (57 extensions, 500+ functions, 100+ classes)

Installation

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 docs/getting-started.md for supported targets.

From crates.io

cargo install mir-php

Build from source

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

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 docs/cli.md for the full CLI reference.

Documentation

Full documentation is available at jorgsowa.github.io/mir.

Contributing

See CONTRIBUTING.md.

License

MIT

Dependencies

~1–2MB
~37K SLoC