- Can I use this package for a pure Laravel project without REDAXO integration?
- This package is specialized for REDAXO’s coding standards (e.g., PhpdocLineSpanFixer, PHP 8.4 migration rules), which may conflict with Laravel’s PSR-12 defaults. For vanilla Laravel, generic configs like `friendsofphp/php-cs-fixer` are a better fit. You could layer custom rules on top, but conflicts (e.g., `short_echo_tag` vs. Laravel’s `blank_line_after_opening_tag`) will require manual overrides.
- How do I install and configure this for a Laravel-REDAXO hybrid project?
- Run `composer require --dev redaxo/php-cs-fixer-config`, then create a `.php-cs-fixer.dist.php` file with `Config::redaxo5()` or `Config::redaxo6()` and set your file finder. For Laravel compatibility, override conflicting rules like `short_echo_tag` or merge with `@PSR12` in the config. Example: `Config::redaxo5()->setRules(['short_echo_tag' => false, '@PSR12' => true]).`
- What Laravel versions and PHP versions does this package support?
- This package requires **PHP 8.3+** (due to its dependency on PHP-CS-Fixer v3.94.2+), which may exclude older Laravel LTS versions (e.g., Laravel 8.x on PHP 8.1). For Laravel 9/10, compatibility is neutral if you override REDAXO-specific rules. Test thoroughly, as strict rules like `fully_qualified_strict_types` may clash with Laravel’s defaults.
- Is this package actively maintained? The GitHub repo appears inactive.
- The package’s repository is **unpublished or inaccessible**, raising significant maintenance risks. There’s no visible GitHub activity, stars, or issue tracking. If critical, fork the package privately or copy-paste its rules into a custom config. Check REDAXO’s core team for updates, but assume no official support unless confirmed.
- How do I integrate this into GitHub Actions for CI/CD?
- Add a step to your workflow using the `php-cs-fixer` CLI, e.g., `php-cs-fixer fix --rules=@redaxo5 --diff`. The package supports parallel execution (`enableParallel()`), which is ideal for large codebases. Example workflow: `name: PHP-CS-Fixer; on: [push]; jobs: fix: runs-on: ubuntu-latest; steps: - uses: actions/checkout; - run: composer require --dev redaxo/php-cs-fixer-config; - run: vendor/bin/php-cs-fixer fix --dry-run --allow-risky=yes.`
- What are the biggest risks of using this in a Laravel project?
- Key risks include **rule conflicts** (e.g., REDAXO’s `short_echo_tag` vs. Laravel’s `blank_line_after_opening_tag`) and **PHP 8.3+ dependency**, which may break legacy Laravel apps. The package’s **unpublished repo** also introduces security and maintenance uncertainty. Mitigate by testing with `--dry-run`, overriding rules, or using it as a reference for a custom config.
- Can I customize the REDAXO rules for Laravel-specific needs?
- Yes, extend the config in `.php-cs-fixer.dist.php` using `Config::redaxo5()->setRules([...])` or `with()`. For example, disable `short_echo_tag` or enable `@PSR12` for Laravel compatibility. You can also merge custom rulesets: `Config::redaxo5()->with([__DIR__.'/custom_rules.php'])` to load additional fixes.
- Are there alternatives for Laravel projects that need REDAXO-style formatting?
- For Laravel-only projects, use `friendsofphp/php-cs-fixer` with a custom config extending `@PSR12` or `@Symfony`. If you *must* adopt REDAXO’s rules, fork this package privately or copy its rules into a custom config. Alternatives like `laravel-shift/php-cs-fixer-config` are Laravel-native but lack REDAXO’s specialized fixes (e.g., `PhpdocLineSpanFixer`).
- How do I handle large Laravel monorepos (e.g., 50K+ files) with this config?
- Leverage the package’s `enableParallel()` method for faster execution. Test performance with `--dry-run` first, as strict REDAXO rules (e.g., `ordered_imports`) may slow down large codebases. For CI/CD, cache dependencies and use GitHub Actions’ `actions/cache` to speed up repeated runs. If bottlenecks persist, consider splitting the config by directory or disabling non-critical rules.
- Does this package support pre-commit hooks for Laravel?
- Yes, integrate it with tools like `robo.li` or `php-cs-fixer`’s native hooks. Example for `php-cs-fixer` in `.php-cs-fixer.dist.php`: `return Config::redaxo5()->setFinder($finder)->enableParallel();`. Then add a pre-commit hook in your repo’s `.git/hooks/pre-commit` or use a tool like `husky` to run `vendor/bin/php-cs-fixer fix --dry-run` before commits. Test thoroughly to avoid false positives.