- Can I use this package in a pure Laravel project without Symfony components?
- This package is primarily designed for Symfony-based projects, so direct integration with Laravel may require custom adapters. You can still use its code quality tools (like PHPStan or pre-commit hooks) via Composer scripts, but testing utilities assume Symfony’s WebTestCase and Kernel, which won’t work out-of-the-box in Laravel.
- How do I install **cubetools/cube-common-develop** in my Laravel project?
- Run `composer require --dev cubetools/cube-common-develop` in your project directory. Ensure Composer is installed globally and your Laravel project supports PHPUnit 7+ and PHPStan, as the package relies on these tools. Add it to your `devDependencies` for development-only use.
- Will this package work with Laravel 10+ or PHP 8.2+?
- The package hasn’t been updated since 2020 and lacks explicit Laravel 10 or PHP 8.2 compatibility checks. While it may work for basic utilities (like PHPStan), Symfony-specific features (e.g., service.yaml or WebTestCase) could break. Test thoroughly or use it cautiously in legacy projects.
- Can I use the pre-commit hooks (check-commit-cube.sh) in Laravel?
- Yes, the pre-commit hooks (e.g., Twig template validation, route checks) can be adapted for Laravel via Git hooks or Composer scripts. Modify the hook to target Laravel-specific paths (e.g., `resources/views` instead of Symfony’s templates) and ensure dependencies like PHPStan are compatible with Laravel’s ecosystem.
- How do I adapt the testing utilities (BaseTest, SmoketestPageLoadingBase) for Laravel?
- The testing classes assume Symfony’s WebTestCase, so you’ll need to create a wrapper trait or abstract class to bridge them with Laravel’s HttpTests or PestPHP. For example, extend Laravel’s `TestCase` and override methods like `createClient()` to use Symfony’s WebTestCase internally, but handle Laravel’s service container separately.
- Are there Laravel alternatives to this package’s testing helpers?
- Yes, consider **spatie/laravel-test-tools**, **laravel-shift/blueprint**, or Laravel’s built-in **HttpTests** for integration testing. These are natively Laravel-compatible and avoid Symfony dependencies. If you need Symfony-like features (e.g., WebTestCase), evaluate the effort of creating adapters versus the value gained.
- Will this package conflict with Laravel’s service container or Artisan?
- The package uses Symfony’s `service.yaml` and `bin/console`, which won’t integrate directly with Laravel’s Artisan or service container. For CLI tools, wrap Symfony commands in Laravel Artisan commands. For services, manually define them in Laravel’s `config/services.php` or use a service provider to bridge the gap.
- How do I handle PHPUnit vs. PestPHP conflicts if I use this package?
- This package relies on PHPUnit 7+, so if your project uses PestPHP, you’ll need to either: 1) Configure Pest to work alongside PHPUnit, 2) Use the package’s utilities in a separate PHPUnit test suite, or 3) Fork and adapt the testing classes to work with Pest’s syntax. Avoid mixing test runners without isolation.
- What maintenance risks should I consider before adopting this package?
- The package is **3+ years outdated** with no active maintenance, posing risks for Laravel 10+ or PHP 8.2+. Symfony 4.3+ compatibility is noted, but Laravel’s evolving stack (e.g., Symfony 6/7 components) may introduce breaking changes. Plan for forks or custom patches if critical features are needed long-term.
- Can I use this package’s XLiff file reordering tool in Laravel?
- Yes, the XLiff tooling is language-agnostic and can be used in Laravel projects via Composer scripts or custom Artisan commands. Ensure the tool’s dependencies (e.g., Symfony’s Console component) are compatible with your Laravel setup. Test it in a non-critical environment first to verify behavior.