shipmonk/coding-standard
ShipMonk’s PHP_CodeSniffer ruleset for consistent PHP style across ShipMonk packages. Install via Composer, add a phpcs.xml.dist pointing to ShipMonkCodingStandard, then run phpcs to check and phpcbf to auto-fix issues.
slevomat/coding-standard as a base. It is highly compatible with Laravel projects, as Laravel already uses PHPCS for static analysis (e.g., via laravel-shift/php-code-style or custom rulesets).slevomat/coding-standard) suggests it follows modern PHP best practices (PSR-12, Slevomat rules). A TPM should assess whether ShipMonk’s rules align with or conflict with existing Laravel conventions (e.g., naming, docblock, or class structure rules).phpcs (already common in PHP projects).- name: Run PHPCS
run: vendor/bin/phpcs --standard=ShipMonkCodingStandard src tests
App\ namespace, Facade usage).psr12, slevomat).use App\Helpers\* might break Laravel’s service container conventions.snake_case for method names when Laravel uses camelCase?phpcs.xml.dist helps.)slevomat/coding-standard?psr12, laravel-shift/php-code-style).composer.json as a dev dependency:
composer require --dev shipmonk/coding-standard
phpcs.xml.dist alongside existing rulesets (merge or override).phpcbf) in PRs.<exclude-pattern>*/App/Exceptions/*.php</exclude-pattern>
Facade usage (e.g., use App\Facades\Cache).
handle() method signatures.phpcs version compatibility (ShipMonk’s package likely targets PHP 8.1+).laravel-shift/php-code-style (if used).| Step | Action | Tools/Artifacts |
|---|---|---|
| 1 | Install package | composer require shipmonk/coding-standard |
| 2 | Configure PHPCS | phpcs.xml.dist (merge with existing rules) |
| 3 | Baseline analysis | vendor/bin/phpcs --standard=ShipMonkCodingStandard src |
| 4 | Conflict resolution | Adjust rules or exclude paths |
| 5 | CI integration | Add PHPCS to GitHub Actions/GitLab CI |
| 6 | Auto-fix enablement | phpcbf for safe violations |
| 7 | Documentation | Update team on new standards |
composer.json to avoid surprises.<arg name="cache" value="var/phpcs.cache"/>).php-parallel-lint for faster scans.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Rule conflicts break CI | Blocked merges | Run pre-integration analysis; whitelist exceptions. |
| PHPCS performance slows CI | Flaky pipelines | Cache results; run in parallel. |
| ShipMonk rules become obsolete | Technical debt | Monitor updates; plan for fork/switch. |
| Team resistance to new rules | Low adoption | Pilot with volunteers; highlight benefits (consistency, fewer PR comments). |
| False positives in legacy code | Manual fixes needed | Use phpcbf for |
How can I help you explore Laravel packages today?