thecodingmachine/phpstan-strict-rules
Extra-strict PHPStan ruleset that flags risky or inconsistent PHP patterns beyond the default checks. Helps enforce cleaner, safer code by catching edge cases and enforcing best practices, with easy opt-in configuration for existing PHPStan setups.
Architecture fit: PHPStan is a development-time static analysis tool; this package extends its functionality with additional rules. It integrates as a dev dependency without impacting runtime architecture, making it suitable for code quality enforcement in CI/CD pipelines.
Integration feasibility: Simple to add via Composer, but last release in 2021 raises concerns about compatibility with modern PHP versions (e.g., PHP 8.1+) and newer PHPStan versions. Unknown repository complicates dependency tracking and security auditing.
Technical risk: High risk of breaking changes due to outdated codebase; potential incompatibility with current PHP/PHPStan versions. Lack of recent maintenance increases vulnerability exposure and unresolved bugs.
Key questions: What PHP/PHPStan versions are in use? How many existing code violations would these rules surface? Is there active community maintenance or forks addressing compatibility? Are there more recent alternatives (e.g., phpstan/phpstan-strict-rules)?
Stack fit: Ideal for teams already using PHPStan for static analysis. Not viable for projects without existing static analysis tooling, requiring PHPStan adoption first.
Migration path: Start with minimal rule configuration, run scans locally to identify critical issues, then incrementally enable rules in CI while addressing errors. Prioritize rules with low refactoring impact (e.g., type checks) before stricter ones (e.g., null safety).
Compatibility: Requires explicit PHPStan version pinning (e.g., ^0.12), as newer PHPStan versions may break compatibility. Must validate against current stack and test edge cases.
Sequencing: Phase 1: Enable non-breaking rules in CI (e.g., strictNullChecks). Phase 2: Gradually introduce stricter rules with code fixes. Phase 3: Automate fixes via phpstan-strict-rules-compatible coders where possible.
Maintenance: High burden due to inactivity; team may need to fork and maintain the package for bug fixes or compatibility. Requires ongoing monitoring for security issues in dependencies.
Support: Limited external support due to unknown repository and lack of recent activity. Reliance on internal expertise for troubleshooting and customization.
Scaling: Analysis time increases linearly with rule count; may impact CI pipeline performance for large codebases. Requires resource allocation for rule tuning and performance optimization.
Failure modes: CI pipeline failures due to strict rules blocking deployments. Risk of false positives causing developer friction; requires careful rule configuration and exception handling.
Ramp-up: Developers need training on new rules and refactoring patterns. Documentation may be sparse; internal knowledge-sharing sessions and rule-specific
How can I help you explore Laravel packages today?