- Can I use this package for Laravel projects to enforce Symfony2 coding standards?
- No, this package is explicitly designed for Symfony2 and is incompatible with Laravel. Laravel follows its own PSR-compliant standards (e.g., laravel-shift/laravel-coding-standard), and forcing this tool would break Laravel’s toolchain, including php-cs-fixer, Pint, and Laravel-specific rules like Blade syntax.
- Will this work with Laravel 9 or PHP 8.1+?
- Absolutely not. This package was last updated in 2016 and relies on Symfony2, which dropped PHP 8+ support entirely. Running it in a Laravel 9+ project would fail due to deprecated Symfony2 components and missing PHP 8 features.
- How do I enforce Symfony2 coding standards in a Laravel project?
- If you’re migrating Symfony2 code to Laravel, refactor it to Laravel’s conventions first. Use Laravel-native tools like `php-cs-fixer` with the `--rules` flag or `laravel-shift/laravel-coding-standard` for consistent style. Avoid mixing toolchains—it introduces conflicts and maintenance overhead.
- Does this package integrate with Laravel’s testing tools like Pest or PHPUnit?
- No, this package has zero integration with Laravel’s testing ecosystem. It’s designed for Symfony2’s testing workflows (e.g., PHPUnit with Symfony bundles) and would ignore Laravel-specific testing patterns like Facades, Eloquent, or Blade templates.
- What are the risks of using this in production?
- Major risks include breaking changes (Symfony2’s deprecated DI container won’t work with Laravel’s service container), security vulnerabilities (unpatched Symfony 2.3+ dependencies), and toolchain conflicts (e.g., duplicate `symfony/yaml` or `symfony/console` versions). It’s not production-ready for Laravel.
- Are there alternatives for Symfony2-style code in Laravel?
- Yes. Use `php-cs-fixer` with Symfony2 rules (via `--config` or custom presets) for partial compatibility, or rewrite Symfony2 code to Laravel’s standards using `rector` for automated refactoring. For full Laravel compliance, adopt `laravel-shift/laravel-coding-standard`.
- How do I install this package in a Laravel project?
- You *can* install it via Composer (`composer require-dev m6web/symfony2-coding-standard`), but it won’t work natively. You’d need to manually configure it with `./vendor/bin/phpcs --standard=vendor/m6web/symfony2-coding-standard/Symfony2`, but this ignores Laravel’s tooling entirely.
- Will this package conflict with Laravel’s service providers or facades?
- Yes. Symfony2’s dependency injection and event system are fundamentally incompatible with Laravel’s service providers and Facades. Running this tool would either fail or produce false positives/negatives for Laravel-specific code like `Route::resource()` or `Auth::user()`.
- Is there a way to adapt this for Laravel without rewriting?
- No practical way exists. Even if you fork and modify it, you’d need to rewrite Symfony2-specific rules (e.g., for Twig vs. Blade, Doctrine vs. Eloquent) and handle namespace collisions. The effort outweighs the benefits—modern Laravel tools already cover these use cases.
- Why is this package still on Packagist if it’s abandoned?
- This package was forked from an older Symfony2 standard and never updated for Laravel or modern PHP. While it remains on Packagist, it’s effectively deprecated. The original maintainers (M6Web) haven’t touched it since 2016, and no Laravel-compatible fork exists.