drupol/php-conventions
Opinionated PHP conventions toolkit with presets for code style, static analysis, and QA tooling. Helps standardize projects quickly by providing shared configuration and automation-friendly defaults for common PHP workflows.
Pros:
laravel-shift/blueprint, phpstan/extension-installer).Cons:
phpstan/extension-installer (for PHPStan integration).dealerdirect/phpcodesniffer-composer-installer (for PHPCS).laravel/pint (for auto-formatting).Key Fit Areas:
Low-to-Medium Effort:
composer require drupol/php-conventions), minimal setup.phpstan.neon and PHPCS rules alignment (may conflict with existing configs).phpunit ruleset).Potential Conflicts:
| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Rule Overlap | Medium | Audit existing PHPCS/PHPStan configs pre-integration. |
| CI Pipeline Impact | High | Benchmark PHPStan execution time; cache results. |
| Developer Resistance | Medium | Pilot with a subset of the team; provide clear docs. |
| Laravel-Specific Gaps | Low | Supplement with custom PHPCS rulesets for Laravel patterns. |
| Maintenance Burden | Low | MIT license allows forks; monitor upstream updates. |
pint, phpstan/extension-installer) instead?
Best For:
Poor Fit:
Complementary Tools:
| Tool | Purpose |
|---|---|
phpstan/extension-installer |
Auto-load PHPStan extensions. |
dealerdirect/phpcodesniffer-composer-installer |
Auto-install PHPCS. |
laravel/pint |
Auto-format code (reduces PHPCS noise). |
rector/rector |
Automate refactoring (if conventions are violated). |
phpcs and phpstan against the codebase to identify current violations.drupol/php-conventions in a feature branch or new module.phpstan.neon and PHPCS rulesets to match Laravel’s defaults.- name: PHPStan
run: vendor/bin/phpstan analyse --level=max
- name: PHPCS
run: vendor/bin/phpcs --standard=phpconventions
husky + phpcs).=== instead of ==").Helper::str()) may violate PSR-12.phpstan.neon exclusions:
excludes:
- migrations/*
- storage/*
- vendor/*
<arg value="--ignore=app/Helpers.php"/>
| Phase | Tasks | Dependencies |
|---|---|---|
| Prep | Audit existing rules, benchmark PHPStan, gather stakeholder input. | None |
| Pilot | Install in a branch, test with a small team. | CI/CD access, developer feedback |
| CI Integration | Add to pipeline, set failure modes. | Pilot success |
| Onboarding | Docs, training, pre-commit hooks. | CI stability |
| Enforcement | Block PRs on violations, expand scope. | Team adoption |
phpstan/phpstan and squizlabs/php_codesniffer in composer.json.collect() method triggering unused-function rules).phpstan --generate-baseline to suppress known issues temporarily.How can I help you explore Laravel packages today?