wyrihaximus/phpstan-rules-wrapper
WyriHaximus PHPStan Rules Wrapper bundles popular PHPStan rulesets—ergebnis, strict, deprecation, PHPUnit, Mockery, ShipMonk, Symplify, PSR-3 and more—into one Composer package. Install it and, thanks to phpstan/extension-installer, the included rules work out of the box.
Architecture fit. This is a Composer metapackage, not a framework component. It ships no application code: its entire payload is a composer.json that requires eleven third-party PHPStan rule packages plus a phpstan.neon that enables them, and it relies on phpstan/extension-installer to auto-register everything on install. That makes it a configuration consolidation artifact. It fits only projects that already run PHPStan; for a Laravel codebase with no static analysis, adopting this means adopting PHPStan, extension-installer, and an opinionated opinion-set in one step.
Integration feasibility. Mechanically trivial — one composer require and zero application code changes, no runtime surface, no migrations, no service wiring. Rollback is a single composer remove. The real cost is behavioral, not mechanical: because extension-installer auto-loads every bundled ruleset, the first run will emit the union of eleven rule sets' findings against a codebase that has never been measured against them. For a mature Laravel app that is realistically hundreds to low thousands of new errors.
Technical risk.
ignoreErrors, which is the worst kind of configuration debt.ergebnis/phpstan-rules because that package hadn't caught up (re-added in 10.1.0). This pattern means the wrapper's major versions gate your PHPStan upgrade timing, and a lagging upstream rule package can block you.ergebnis rules as a bug fix; 8.0.0 dropped thecodingmachine packages entirely. Coverage can shrink in a "minor" release. Your quality gate is not stable by contract.Key questions.
ignoreErrors baseline, and what is the policy for retiring entries?wyrihaximus/phpstan-no-safe, strict types, dead-code detection) compatible with our code style, or will it generate noise we permanently suppress?Stack fit. Appropriate for PHP 8.x Laravel applications and libraries that (a) already have PHPStan in require-dev, (b) have phpstan/extension-installer allowed in composer.json's allow-plugins, and (c) have CI capable of running analysis on every PR. It is a poor fit for teams that have not yet reached PHPStan level 5–6 clean, because the incremental signal from strict/type-coverage rules is drowned by baseline noise at lower levels.
Migration path. Treat this as a greenfield quality-gate decision, not a dependency swap.
composer require --dev wyrihaximus/phpstan-rules-wrapper, confirm extension-installer registers it, run analysis, and capture the new error count by rule identifier. That distribution is the decision input.phpstan.neon with a comment and an owner).Compatibility. Pin the wrapper exactly ("14.5.0" or a tight range) rather than ^, because its minors carry rule changes. Keep PHPStan itself on an explicit version too; the wrapper's major tracks PHPStan's major, so upgrade them in the same PR. Verify PHP version constraints across all eleven transitive rule packages — the tightest one governs.
Sequencing. Do not combine this with a PHPStan level increase, a Laravel major upgrade, or a PHP version bump. Each of those changes the error population independently, and confounding them makes the baseline unattributable. If a bundled rule package is abandoned mid-adoption (the ergebnis/PHPStan v2 episode is the precedent), be prepared to pin the wrapper to the last working minor and wait, or vendor the specific rule set directly and drop the wrapper.
Maintenance. Ongoing effort is dominated by dependency churn, not by this package's own code. Expect frequent patch/minor releases; a Renovate or Dependabot PR per week is plausible. Budget roughly one review cycle per month for the wrapper and its lockfile delta. The real maintenance cost is the ignoreErrors baseline — an unowned baseline grows monotonically and quietly converts the gate into theater.
Support. Support options are the GitHub issue tracker and the maintainer's discretion. No vendor, no SLA, no LTS. Mitigation is architectural, not contractual: because the package is a thin aggregator, the exit path is to composer remove it and require the individual rule packages you actually use, copying over the relevant phpstan.neon includes. Keep a note of which includes you rely on so that exit takes an hour, not a day.
Scaling. Effectively free at any repository size — analysis cost scales with codebase size and PHPStan settings, not with the number of rule packages. The scaling concern is organizational: across many repos, an auto-loading metapackage means every repo silently inherits whatever the maintainer shipped that week. Standardize on an exact pinned version in a shared internal tooling package and let teams opt into upgrades deliberately.
Failure modes.
ignoreErrors by default. Mitigation: baseline review at each upgrade, and cap its size.composer update on an unrelated package. Mitigation: lockfile discipline and a dedicated CI job.phpstan.neon settings or with another auto-registered extension. Diagnose with phpstan --debug style output of the resolved config.Ramp-up. Engineer time to first successful run is under an hour; time to a trustworthy, blocking gate is closer to one to two weeks of triage for an established codebase. Knowledge transfer is minimal but concentrated: one person should own the phpstan.neon configuration and the baseline, and that ownership should be explicit, because this package's value proposition — one-line adoption of eleven rule sets — is exactly the kind of convenience that becomes invisible infrastructure no one understands six months later.
How can I help you explore Laravel packages today?