- Is this package compatible with Laravel 10 and PHP 8.1+?
- No, this package was last updated in 2018 and lacks PHP 8.x support. It may fail due to deprecated syntax like dynamic properties or union types. Test thoroughly before use, or fork it to update dependencies.
- How do I integrate this into Laravel’s CI pipeline?
- Add it as a GitHub Actions or GitLab CI step using `vendor/bin/phpcs --standard=lookyman`. Example: `run: vendor/bin/phpcs --standard=lookyman --runtime-set installed_paths ./vendor/lookyman/coding-standard`.
- Does this package support Laravel-specific rules (e.g., Blade templates, Facades)?
- No, it enforces generic PHP standards (PSR-1/PSR-2) and lacks Laravel-specific rules. For Blade or Facade checks, use alternatives like `php-cs-fixer` with custom rules or `laravel-shift/blade-style-guide`.
- Can I migrate existing rules to php-cs-fixer?
- Yes, compare outputs with `php-cs-fixer --dry-run` to identify gaps. Recreate rules in `.php-cs-fixer.dist.php` using the `--ruleset-file` option. This is the recommended long-term approach.
- Will this break if I use modern PHP features like arrow functions?
- Likely yes. The package enforces outdated standards (e.g., PSR-1/PSR-2) and may flag modern Laravel patterns like arrow functions (`fn()`) or named arguments as violations.
- How do I configure custom exceptions for legacy code?
- Extend the `ruleset.xml` to ignore specific files/directories. Example: `<exclude-pattern>*/legacy/*</exclude-pattern>`. Document exceptions in your team’s coding guidelines.
- Are there alternatives for Laravel-specific coding standards?
- Yes. Use `php-cs-fixer` (PSR-12) or `pint` for modern PHP, and `laravel-shift/blade-style-guide` for Blade templates. For Facade/Service Container rules, create custom `php-cs-fixer` rules.
- Can I run this as a pre-commit hook in Laravel?
- Yes, but it’s not recommended due to the package’s outdated state. Instead, use `husky` with `php-cs-fixer` or `pint` for pre-commit checks. This package is better suited for CI/CD.
- What’s the deprecation risk of using this package?
- High. The package is unmaintained, lacks PHP 8.x support, and conflicts with modern tooling. Plan to migrate to `php-cs-fixer` or `pint` within 6–12 months to avoid technical debt.
- How do I fork and update this for Laravel 10?
- Fork the repo, update `composer.json` to require PHP_CodeSniffer v3+, and modify `ruleset.xml` to align with PSR-12. Publish as `vendor/yourname/laravel-coding-standard` to avoid vendor lock-in.