mir
See it in action
Section titled “See it in action”Adopt it today. Fix issues over time.
Section titled “Adopt it today. Fix issues over time.”Install
Add it as a Composer dev dependency. The prebuilt binary for your platform is downloaded and its checksum verified.
composer require --dev miropen/mir-phpRecord a baseline
Save today’s issues so only new ones are reported. Existing
@psalm-*and@phpstan-*annotations are read as they are.vendor/bin/mir --set-baselineGate every pull request
Report new issues as inline annotations in CI. Exit code
1fails the build.vendor/bin/mir --format github-actions
Install
Section titled “Install”composer require --dev miropen/mir-phpvendor/bin/mir src/cargo install mir-phpmir src/git clone https://github.com/jorgsowa/mir.gitcd mir && cargo build --release./target/release/mir src/Browse by category
Section titled “Browse by category”UndefinedMissing variables, functions, methods, classes, properties, constants.
NullabilityNull arguments, dereferences, returns; possibly-null variants.
Type mismatchesArguments, return types, casts, operands, by-reference passing.
ArrayInvalid offsets and access on possibly-missing keys.
RedundancyConditions that can't fail, casts and annotations that do nothing.
Dead codeUnused variables, parameters, methods, properties, functions; unreachable code.
InheritanceAbstract / interface compliance, signature and visibility mismatches, final violations.
SecurityTaint analysis from `$_GET` / `$_POST` to HTML, SQL, shell, header, SSRF and other sinks.
Generics`@template` parameter constraint and substitution checks.
OtherDeprecations, internal access, throws, readonly, parse and docblock errors.
Get going
Section titled “Get going”Why mir?What mir is designed for and how it works.
Getting StartedInstall, run your first analysis, understand the output.
Migrating to mirKeep your existing annotations, config and baseline.
Configuration`mir.xml`, error levels, issue handlers, baselines.
CLI ReferenceEvery flag, output format, exit code.
IssuesEvery issue mir reports, with examples and fixes.
Run it on your code.
No sign-up and no config file needed. Paste a snippet into the playground, or point the binary at your src/.
- 196
- documented issues
- 7.4–8.6
- PHP versions
- 5
- output formats
- MIT
- license
