Review main Merged

67635[FEATURE] Implement lazy console command list

Benjamin Franzke CR +2 V +2 Hard +453 −93 updated 02/09/21, 09:39

Commit message

Based on the configuration syntax of the Symfony Console
feature https://github.com/symfony/symfony/pull/39851
…but implemented differently, using a registry pattern
rather then a lazy-object pattern (like symfony does).

Main motiviation for the registry pattern is following:
Symfony LazyCommand wrappers add quite some complexity only
for the sake of the list command, we already got lazy
commands (in terms of execution) as our CommandRegistry
implements the ConfigurationLoaderInterface that has been
introduced by 2017 to add support for lazy commands.

Now, that means we already got a registry for lazy commands,
so it is logical to add lazy description handling there as well.

We want to assure that the command list will never instantiate
any commands. This is in constrast to the Symfony core LazyCommand
approach, where legacy commands, that do not provide a compile time
description, would still be instantiated during console command list.

Also commands that return false in `isEnabled()` are now listed.
That means enabled state is only evaluated during runtime.
Therefore the special `dumpautoload` command is transformed into a
lowlevel command in order to be hidden dependending on being run
in composer-mode or not.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 41

Show 21 more files