- Can I use jms/command-bundle in a Laravel application?
- No. jms/command-bundle is a Symfony2 bundle that registers through AppKernel::registerBundles() and the Symfony DI container, while Laravel uses service providers and the Artisan console kernel. There is no adapter that makes a Symfony2 bundle loadable in Laravel, and Composer will usually block the install because the bundle requires Symfony 2.x components that conflict with the Symfony 6/7 components used by modern Laravel. The only realistic use is reading its command classes and reimplementing the ones you need as native Artisan commands.
- Does jms/command-bundle support Laravel 9, 10, or 11?
- No. The bundle targets Symfony 2.0 through 2.8 and PHP 5-era code, while Laravel 9, 10, and 11 depend on Symfony 6 or 7 components and PHP 8.1 or newer. Those requirements conflict transitively, so Composer dependency resolution will fail even for a dev-only install. Use Laravel's native command bus and Artisan instead.
- How do I install jms/command-bundle?
- In a Symfony2 application you would add the bundle to AppKernel::registerBundles() and install it with Composer, then configure services through Symfony's DI container. There is no Laravel installation path because Laravel has no bundle registration mechanism. Attempting composer require in a modern Laravel project will almost certainly fail on platform and Symfony version constraints.
- What does jms/command-bundle actually do?
- It integrates a command bus that dispatches command objects to service-based handlers, adds middleware support for cross-cutting concerns, and encourages organizing business operations into explicit, decoupled, testable command classes. It is a developer-convenience layer for Symfony2 applications. The value is mostly in the command bus pattern and a small set of console commands.
- Is jms/command-bundle maintained?
- Treat it as unmaintained. Symfony 2.8 reached end of life in November 2018, the package has roughly 44 stars and zero dependents on Packagist, and that combination means no downstream compatibility testing or bug reporting. No maintained fork is described in the package context. Do not rely on it for security or PHP 8 compatibility.
- What are the Laravel alternatives to jms/command-bundle?
- Laravel already provides a command bus through its bus and queue system, including dispatch() and dispatchSync() for command and job objects, plus Artisan for console commands. You can create explicit command classes and handler-style services with service providers and dependency injection. For console tooling, php artisan make:command and custom Artisan commands cover most of what this bundle offered.
- Can I port jms/command-bundle commands to Artisan?
- Yes, but as a rewrite rather than a compatibility shim. Start by auditing the bundle's Command directory to list each command, its inputs, and side effects, then triage each one as already covered by Artisan, trivial to reproduce, or genuinely non-trivial. Port only the non-trivial ones as Illuminate\Console\Command subclasses registered in a service provider, add tests, and keep the original license and attribution headers.
- Does jms/command-bundle work on PHP 8.1 or PHP 8.2?
- Not reliably. The code targets PHP 5.x idioms and Symfony 2.x DI semantics, so it is unlikely to run cleanly on the PHP 8.1+ versions supported by current Laravel. Even with --ignore-platform-reqs you would inherit unpatched dependency risk and no security backport path. Modernize or reimplement instead.
- How should I test commands copied from jms/command-bundle?
- Test them as Laravel Artisan commands rather than through Symfony bundle testing infrastructure. Use Laravel's command tests to assert exit codes and output, mock or fake the handler services, and cover side effects explicitly. Because the original code has no compatibility testing downstream, write your own coverage before trusting a port.
- Is jms/command-bundle a safe production dependency for a Laravel app?
- No. It is a Symfony2-era bundle with an end-of-life Symfony dependency, no active maintenance signal, and no Laravel integration path, so adding it to production would create unpatched risk without solving a Laravel problem. Use it only as a read-only reference for command ideas, and implement what you need with Laravel's native bus, queues, and Artisan.