- What is genealabs/php-coding-standards and what does it do?
- It is a Composer package from GeneaLabs that ships a ready-made, opinionated PHP coding-standards ruleset for Laravel and general PHP projects. It is developer tooling that lives in require-dev alongside PHP_CodeSniffer so repositories stop hand-rolling their own lint configuration. It adds no runtime code to your application.
- How do I install genealabs/php-coding-standards in a Laravel project?
- Install it as a dev dependency with composer require --dev genealabs/php-coding-standards. Then add or update a phpcs.xml in your project root that references the shipped standard. Keep it in require-dev so it never ships to production, and confirm it resolves cleanly in a fresh Composer project before rolling it out.
- Which PHP and Laravel versions does this coding standard support?
- The 0.2.0 release bumped Slevomat Coding Standard to v7, which pins a specific PHP_CodeSniffer generation and implies a PHP version ceiling. There has been no release since November 2021, so there is no published support statement for current PHP or Laravel versions. Treat modern compatibility as unproven and validate it against your own version matrix before adopting.
- How do I configure phpcs.xml to use this ruleset?
- Point phpcs.xml at the package's ruleset, ideally by relative path inside vendor rather than registering the standard by name through installed_paths. Registering by name is machine-local and tends to break on fresh checkouts and CI runners. A short spike should confirm whether the package ships a ruleset.xml or custom sniffs in src.
- Does genealabs/php-coding-standards work with Laravel Pint?
- Not directly. Laravel Pint wraps PHP-CS-Fixer, while this package is a PHP_CodeSniffer ruleset, so they use different engines and cannot share configuration. Teams already standardized on Pint should treat this package as a reference for rules rather than a drop-in replacement. Running both engines on the same repository usually is not worth the duplication.
- Is genealabs/php-coding-standards still maintained?
- Adoption signals are weak: roughly 16 stars, zero dependents, and no release since November 2021. The only documented 0.2.0 change was an upstream Slevomat dependency bump. In practice the upstream project is inactive, so plan to own the rules internally if you adopt them.
- Is genealabs/php-coding-standards safe to use in production?
- It is a require-dev tool, so it has near-zero production blast radius and never executes inside your application. The real costs are developer time and review credibility rather than runtime risk. Install it as a dev dependency only, pin the version, and keep it out of production builds.
- How do I test or pilot this coding standard in CI?
- Start with a report-only run on a single representative repository, then diff the findings against your existing Pint or PHP_CodeSniffer baseline. Define an exit criterion up front, such as a number of accepted rules or a clean report-only run, before enforcing anything. Enforce incrementally with a baseline file so CI fails only on new violations.
- What are the risks of using a 2021-vintage coding standard?
- Compatibility drift is the main one, since stale sniffs can produce deprecation noise against modern PHP and Laravel. The subtler risk is false confidence, where a green CI run no longer reflects current conventions and creates the appearance of compliance. Mitigate by diffing its rules against your internal baseline and running report-only before enforcing.
- Can I fork genealabs/php-coding-standards and maintain the rules internally?
- That is the recommended framing: treat the durable artifact as the rules, not the package. Audit what the package ships, extract the rules you want into an internal config or fork, and assign an internal owner plus a fork-and-patch policy. Check the repository's license before forking or redistributing it across repositories.