Skip to content

Console 4.3 vs HttpKernel 3.4 issue with command registration  #32798

@dmaicher

Description

@dmaicher

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.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions