mayflower/mo4-coding-standard
PHP_CodeSniffer ruleset implementing the MO4 coding standard. Extends Symfony’s standard with extra sniffs for array formatting and alignment, multiline arrays, property docblock @var rules, and lexicographically sorted use statements (configurable ordering).
phpcbf, reducing manual refactoring effort during PR reviews.Adopt if:
use statements, strict array formatting).Look elsewhere if:
"This package standardizes our PHP/Laravel codebase to reduce technical debt and accelerate development. By enforcing consistent formatting (e.g., aligned arrays, sorted use statements), we cut down on manual code reviews and onboarding time. Most violations auto-fix, so the overhead is minimal—just a one-time setup. It’s a low-cost, high-impact way to improve code quality, especially for teams scaling up."
Key Outcomes:
"MO4 Coding Standard extends Symfony’s rules with opinionated but practical sniffs (e.g., { $var } in strings, aligned associative arrays). It’s lightweight, autofix-friendly, and integrates seamlessly with PHP_CodeSniffer—no reinventing the wheel. We can enforce it via CI (e.g., fail builds on violations) or locally (e.g., pre-commit hooks).
Example wins:
{} (avoids edge cases like $var vs. ${var}).
Downside: It’s opinionated—if your team hates strict alignment, we can tweak or disable rules. But for Laravel projects, it’s a net positive for maintainability."Action Items:
composer.json and test phpcbf on a PR.AlphabeticalUseStatements but disable MultipleEmptyLines).How can I help you explore Laravel packages today?