sabre/cs
Developer-only package providing shared coding standards for sabre/* projects. Install via Composer to enforce consistent style across sabre packages; mainly useful if you maintain or create sabre components.
php-cs-fixer or pint), so this package is redundant unless Sabre-specific rules are required.sabre/dav) or adopting Sabre’s conventions.php-cs-fixer).pint).| Risk Area | Assessment | Mitigation |
|---|---|---|
| Rule Conflicts | High (Sabre’s standards may clash with Laravel’s PSR-12). | Override rules in phpcs.xml or use PHP-CS Fixer’s --rules. |
| Archived Package | High (no updates, potential security/bug risks). | Fork the repo or migrate to PHP-CS Fixer. |
| Tooling Friction | Medium (no native Laravel support). | Build a custom Artisan command or CI step. |
| Maintenance Burden | Medium (requires manual configuration). | Document rules in CONTRIBUTING.md. |
| Performance | Low (static analysis, negligible runtime impact). | N/A |
pint, laravel-pint)?| Component | Compatibility | Notes |
|---|---|---|
| PHP Version | High | Supports PHP 7.2+ (aligned with Laravel’s minimum). |
| Composer | High | Standard require installation. |
| Laravel Ecosystem | Low | No native integration; requires custom setup. |
| PHP_CodeSniffer | High | Sabre/cs is a ruleset for PHP_CodeSniffer (likely already in use). |
| CI/CD (GitHub/GitLab) | High | Easy to add as a linting step. |
| IDE (PHPStorm/VSCode) | Low | No native support; requires external tool configuration. |
Assessment Phase (1-2 Days)
composer require sabre/cs --dev
./vendor/bin/phpcs --standard=sabre --report=full src/
Pilot Integration (3-5 Days)
- name: Sabre CS Lint
run: ./vendor/bin/phpcs --standard=sabre --warning-severity=0 src/ tests/
laravel/hooks to block non-compliant commits:
composer require laravel/hooks
Configure in composer.json:
"scripts": {
"post-autoload-dump": "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"cs-check": "phpcs --standard=sabre --warning-severity=0 src/"
}
Add to .git/hooks/pre-commit:
#!/bin/sh
composer cs-check || exit 1
Conflict Resolution
phpcs.xml to merge Sabre’s rules with Laravel’s:
<?xml version="1.0"?>
<ruleset name="Laravel + Sabre">
<arg name="standard" value="Sabre"/>
<arg name="extensions" value="php"/>
<!-- Override conflicting rules -->
<rule ref="Sabre.Spaces.DisallowExtraSpaceInArray" action="ignore"/>
<file>src/</file>
</ruleset>
Full Rollout (1-2 Weeks)
CONTRIBUTING.md with Sabre’s conventions.Phase 1: Evaluation (1 Week)
Phase 2: Pilot (2 Weeks)
Phase 3: Hybrid Ruleset (1 Week)
Phase 4: Full Enforcement (Ongoing)
| Aspect | Impact | Mitigation Strategy |
|---|---|---|
| Rule Updates | High (archived package) | Fork the repo and maintain internally. |
| Dependency Bloat | Low | Sabre/cs is lightweight; no runtime impact. |
| Configuration Drift | Medium | Document rules in CONTRIBUTING.md and use versioned configs. |
| Tooling Support | Low (no IDE plugins) | Configure PHPStorm/VSCode for external tooling. |
How can I help you explore Laravel packages today?