mnapoli/hard-mode
Hard Mode is a small PHP library by Matthieu Napoli that encourages writing more explicit, robust code by making certain “bad practices” harder or impossible at runtime. Useful for catching hidden assumptions and improving code quality in existing projects.
Architecture fit: Laravel's convention-over-configuration philosophy conflicts with hard-mode's strict enforcement of explicitness. Modern Laravel versions (8+/PHP 8+) rely on features like union types, attributes, and dynamic Eloquent properties that may clash with hard-mode's rules. The package's lack of updates since 2020 suggests incompatibility with current PHP/Laravel ecosystems.
Integration feasibility: Composer installation is trivial, but runtime conflicts are likely. Laravel's error handling (e.g., exception pages, logging) may not gracefully handle hard-mode's strict failures. Critical risk: no public repository means unverifiable code quality and security vulnerabilities.
Technical risk: High. 4+ years of inactivity, 9 stars, and no recent releases indicate abandonment. Likely incompatible with PHP 8.0+ features (e.g., named arguments, match expressions) and Laravel's modern patterns. Could break CI/CD pipelines or introduce production failures.
Key questions: Does it support PHP 8.0+? How does it handle Laravel-specific patterns (e.g., Eloquent dynamic properties, route model binding)? Is it compatible with existing tools like PHPStan or Psalm? What specific rules does it enforce, and are they documented?
Stack fit: Poor. Laravel's flexibility (e.g., nullable relationships, implicit model binding) directly contradicts hard-mode's strictness. Better alternatives exist (
How can I help you explore Laravel packages today?