- What is phphd/coding-standard?
- It is a shared PHP_CodeSniffer coding standard for PHP and Laravel projects. Instead of copying style configs into every repository, you install the package and inherit one maintained ruleset. It is intended to keep formatting and naming consistent across teams and repositories.
- How do I install phphd/coding-standard?
- Install it as a development dependency with Composer, typically using composer require --dev phphd/coding-standard. Because it is a coding standard rather than application runtime code, it belongs in require-dev. After installation, point PHP_CodeSniffer at the standard in your project configuration.
- How do I run PHPCS with phphd/coding-standard?
- Run PHP_CodeSniffer from your project, usually via vendor/bin/phpcs. Configure the phphd standard in phpcs.xml or pass it with the --standard option. You can target specific directories or files to check only the code you care about.
- Does phphd/coding-standard support Laravel conventions?
- Yes, the package is described as compatible with existing Laravel conventions. It is designed for PHP and Laravel projects that want a shared opinionated ruleset. You should still review the ruleset against your team's preferences before rolling it out.
- Can I use phphd/coding-standard in CI pipelines?
- Yes, it is intended to integrate with local development and CI pipelines. Add the PHPCS command to your CI job so style violations fail builds consistently. This lets code reviews focus on logic rather than formatting.
- How do I configure phphd/coding-standard in phpcs.xml?
- Create or update phpcs.xml in your project and reference the installed phphd standard as the ruleset. You can include or exclude paths and add project-specific exclusions there. Keep shared conventions in the package and only override what your project truly needs.
- Can I override or customize the phphd coding standard?
- PHP_CodeSniffer standards can generally be extended or adjusted in your project's phpcs.xml by excluding specific sniffs or paths. The package is meant to centralize shared rules, so broad overrides reduce the benefit of a common standard. Document any project-specific exceptions so they remain intentional.
- What Laravel or PHP versions does phphd/coding-standard support?
- The provided package overview does not list exact PHP or Laravel version constraints. As a PHP_CodeSniffer ruleset, its compatibility depends on the package's Composer requirements and the PHPCS version it targets. Check the package metadata and README for current supported versions before adopting it.
- How is phphd/coding-standard maintained and updated?
- The package is designed for centralized updates: fix or adjust a rule once and apply it across projects by updating the Composer dependency. That avoids maintaining copied style configs in every repository. Review changelogs when upgrading so rule changes do not surprise your CI.
- What are alternatives to phphd/coding-standard?
- Alternatives include maintaining your own PHP_CodeSniffer ruleset or using Laravel-focused tools such as Laravel Pint for formatting. phphd/coding-standard is aimed at teams that want a shared PHPCS standard across PHP and Laravel repositories. The right choice depends on whether you need PHPCS sniffs, formatter-only workflows, or both.