dms/coding-standard
DMS Coding Standard provides a customized PHPCS ruleset for consistent PHP code style across repositories. Based on PSR-1/PSR-2 with Doctrine flavor, enforcing strict_types declarations and return type spacing rules.
composer require --dev dms/coding-standardphpcs.xml (or phpcs.xml.dist) in your project root with:
<?xml version="1.0"?>
<ruleset name="MyProject">
<rule ref="DMS"/>
</ruleset>
vendor/bin/phpcs src/vendor/bin/phpcbf src/declare(strict_types=1) and return type formatting—these are two of the most immediately noticeable deviations from stock PSR-2.phpcs and phpcbf to pre-commit hooks and CI workflows (e.g., GitHub Actions) to catch violations early. Use phpcs --report-summary for concise feedback.vendor/bin/phpcs.vendor/bin/phpcs --baseline=phpcs-baseline.xml src/, then incrementally shrink the baseline as you refactor.@deprecated annotations on methods only in test files—by adding <rule ref="DMS.PHP.StrictTypes"> or custom filePattern filters.declare(strict_types=1) exactly one line after the opening PHP tag—even after docblocks like @codeCoverageIgnore. Misalignment causes sniff failures.:, but a space after in return types, e.g., function foo(): array {}, not function foo() : array {}. Double-check closures with function (): void {}.phpcs -i to confirm the DMS standard is registered.phpcs only on src/ and tests/, but exclude vendor/, build/, and generated code (e.g., var/, dist/).phpcs -s -i to list enabled sniffs, and phpcs -v for verbose output when a sniff fails silently. If errors persist, inspect vendor/dms/coding-standard/Doctrine/ruleset.xml directly—its rules are inherited directly from Doctrine CS v8.How can I help you explore Laravel packages today?