shipmonk/phpstan-rules
ShipMonk PHPStan strict rules adds about 40 opinionated, super-strict checks beyond native PHPStan, targeting gaps like unsafe comparisons, casts, and array keys. Install via Composer, include rules.neon, and disable or reconfigure any rule per project.
readonly, match, generics) to future-proof codebases, aligning with ShipMonk’s own strict PHPStan configurations.enforceNativeReturnTypehint, forbidCast) to migrate older codebases.forbidCheckedExceptionInCallable).classSuffixNaming for class hierarchies).Adopt if:
forbidCast blacklists or classSuffixNaming mappings).Look Elsewhere if:
enforceReadonlyPublicProperty may break legacy classes).readonly, are PHP 8.1+ only)."This package lets us catch critical bugs at development time—like unsafe type comparisons or unhandled exceptions—using ShipMonk’s battle-tested PHPStan rules. By adopting it, we’ll reduce production incidents from PHP edge cases (e.g., null comparisons, mutable public properties) while future-proofing our codebase for PHP 8+. The upfront effort to configure it pays off in long-term maintainability and faster onboarding for new engineers. Think of it as a ‘PHP linter on steroids’—no runtime surprises."
*"This gives us ShipMonk’s strict PHPStan rules (used in their high-scale system) to:
array casts, arithmetic on strings) early.readonly, match for enums) without manual audits.enforceReadonlyPublicProperty for legacy code).
Example: The forbidCheckedExceptionInCallable rule alone would’ve caught X production bugs in our last release by flagging unhandled exceptions in closures. Zero false positives—just stricter defaults we control.*Ask: "Which of these rules align with our top technical debts? We can start with a pilot module."
How can I help you explore Laravel packages today?