-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected: 3.4.30 & 4.3.3
Description
A have a big work project that still requires symfony/framework-bundle
^3.4
but we are slowly upgrading some components already to version ^4.3
.
I discovered one issue while upgrading to symfony/console
^4.3
that has todo with registering commands inside bundles.
- there is one command class inside a bundle which does not have any constructor arguments but it has some
@required
setters and is configured as a DI service with tagconsole.command
- with
symfony/console
version^4.3
the service is not used but the command is instantiated using the legacy bundle discovery here: https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/HttpKernel/Bundle/Bundle.php#L179
How to reproduce
Here is a minimal reproducer: https://github.com/dmaicher/reproducer-sf-command-issue
it@7ec7b105e807:/var/www/reproducer-sf-command-issue (master) $ bin/console foo-command
2019-07-29T14:49:07+02:00 [critical] Call to a member function match() on null
In MyCommand.php line 28:
Call to a member function match() on null
foo-command [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
it@7ec7b105e807:/var/www/reproducer-sf-command-issue (master) $ composer req symfony/console ^3.4
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Downgrading symfony/console (v4.3.3 => v3.4.30): Loading from cache
Writing lock file
Generating autoload files
Executing script cache:clear [OK]
Executing script assets:install public [OK]
it@7ec7b105e807:/var/www/reproducer-sf-command-issue (master) $ bin/console foo-command
foo
it@7ec7b105e807:/var/www/reproducer-sf-command-issue (master) $
Additional
I think its caused by this change #25593
dekey