dealerdirect/phpcodesniffer-composer-installer
Composer installer plugin that automatically discovers and installs PHP_CodeSniffer coding standards (rulesets) from Composer packages. It configures PHPCS installed_paths for you, avoiding manual symlinks and configuration. Supports PHPCS 3/4 and Composer 2.2+.
installed_paths configuration in phpcs.xml by automating PHPCS standard discovery and registration.composer.json and CLI execution (./vendor/bin/phpcs).composer run-script).allow-plugins configuration, which may introduce onboarding friction if teams lack Composer admin rights.packages/). Mitigated via extra.phpcodesniffer-search-depth.require-dev.CI/CD Pipeline Impact:
post-install-cmd or post-update-cmd scripts in Laravel’s composer.json?composer install --no-scripts) break PHPCS standard registration?Performance:
vendor/ for standards during composer install? (Critical for large Laravel monorepos.)Custom Standards:
app/Rules/)? Will they need manual installed_paths entries?Dependency Conflicts:
phpcompatibility/php-compatibility:^9.0 vs. ^10.0) cause runtime errors?Debugging:
phpcs -i vs. composer why-not dealerdirect/phpcodesniffer-composer-installer)installed_paths in phpcs.xml with Composer-managed standards.company/phpcodesniffer-standards) via Packagist.phpcs.xml for manual installed_paths entries.psr12, squizlabs/php_codesniffer) in composer.json.dealerdirect/phpcodesniffer-composer-installer to require-dev.allow-plugins and test with composer install.phpcs -i lists expected standards.installed_paths in phpcs.xml with <config name="installed_paths" value="composer-autoloaded"/>.composer install --no-interaction (with allow-plugins pre-configured).phpcodesniffer-standard type packages (e.g., acme/phpcodesniffer-custom-rules).| Component | Compatibility | Mitigation |
|---|---|---|
| Laravel Version | All (no framework dependencies) | None |
| Composer Version | 2.2+ (Laravel 8+ default) | Downgrade not recommended; upgrade if needed. |
| PHPCS Version | 3.x/4.x (Laravel’s squizlabs/php_codesniffer typically uses 4.x) |
Align versions in require-dev. |
| PHP Version | 5.4+ (Laravel 8+ uses 8.0+) | No impact; Laravel’s PHP version takes precedence. |
| Custom PHPCS Rules | May require manual installed_paths if outside vendor/ |
Use extra.phpcodesniffer-search-depth or symlink. |
squizlabs/php_codesniffer is in require-dev (Laravel typically includes this).dealerdirect/phpcodesniffer-composer-installer to require-dev.composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true or add to composer.json.psr12, wp-coding-standards/wpcs).installed_paths in phpcs.xml with <config name="installed_paths" value="composer-autoloaded"/>.composer install && ./vendor/bin/phpcs -i.composer install --no-interaction to workflows (ensure allow-plugins is configured).phpcs.xml when adding/removing standards (handled by Composer).composer update.composer why-not debugging.composer config allow-plugins....composer.json for phpcodesniffer-standard packages or adjust search-depth.allow-plugins is set in CI environment variables.composer why dealerdirect/phpcodesniffer-composer-installer (checks dependencies)../vendor/bin/phpcs --config-show (validates installed_paths).vendor/.post-install-cmd scripts.composer require --dev).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Composer Plugin Blocked | PHPCS standards not registered; phpcs fails with "no standards found". |
Pre-configure allow-plugins in CI/CD. |
| PHPCS Version Mismatch | Some standards fail to load (e.g., PHPCS |
How can I help you explore Laravel packages today?