Purpose Alignment: This package is a PHPCS rule set designed to enforce Zeta Components' legacy coding standards, which may include PHP 5.x quirks and non-PSR-compliant conventions. It is not a Laravel-specific tool but can be integrated into Laravel projects where Zeta’s legacy codebase exists or where strict alignment with Zeta’s conventions is required.
Key Features:
Laravel-Specific Challenges:
CamelCase vs. snake_case for methods, strict brace styles).array() instead of []), which are deprecated in modern Laravel.php-cs-fixer and phpmd; this package adds another layer of static analysis.Integration Pathways:
dealerdirect/phpcodesniffer).Migration Strategy:
php-cs-fixer or PSR-12 rulesets to balance Zeta’s legacy standards with modern Laravel practices.ruleset.xml to align with Laravel’s conventions.Medium-High Risk:
Mitigation Strategies:
php-cs-fixer for modern formatting and PHPCS for Zeta-specific rules.Business Justification:
Technical Feasibility:
CamelCase methods be enforced globally, or only in legacy modules?Tooling and Workflow:
php-cs-fixer, or run alongside it?Long-Term Viability:
Team Adoption:
php-cs-fixer presets, custom PSR-12 extensions) that could achieve similar goals with lower risk?PHP Ecosystem:
Laravel-Specific:
pint (PHP 8’s built-in formatter) for hybrid workflows.rector for modernizing legacy code while preserving Zeta’s conventions.php-cs-fixer may not support all rules directly.php-cs-fixer for Laravel-specific formatting.Assessment Phase:
composer require --dev zetacomponents/coding-standard phpcs/phpcs
vendor/bin/phpcs --standard=ZetaComponents --report=full src/
Pilot Phase:
# GitHub Actions example
- name: PHPCS (Zeta)
run: vendor/bin/phpcs --standard=ZetaComponents --warning-severity=3 --error-severity=5 src/
Full Adoption:
<!-- .phpcs.xml.dist -->
<config name="standard" value="ZetaComponents"/>
<rule ref="ZetaComponents.Classes.ClassDeclaration.MustNotBeFinal">
<severity>0</severity> <!-- Disable conflicting rule -->
</rule>
Hybrid Workflow:
php-cs-fixer for modern formatting (e.g., imports, braces).php-cs-fixer config:
return (new PhpCsFixerConfig())
->setRules([
'@PSR12' => true,
'@ZetaComponents' => true, // If supported
'array_syntax' => ['syntax' => 'short'], // Override Zeta's preference
]);
PHP Version:
Tooling Conflicts:
php-cs-fixer mayHow can I help you explore Laravel packages today?