[RFC] laminas-cli - Auto-Add Invokable Factory for Commands

I’m about to deprecate a library netglue/laminas-symfony-console that laminas-cli makes obsolete :wink:

One feature this lib has that might be useful is to automatically configure the container to use Invokable Factory for commands that lack a factory definition.

The gist of it is here.

As you’ll see, that feature depends on ServiceManager as the container, which made sense in my own lib because that’s what I use routinely, however, I’m not very familiar with other DI containers supported by Mezzio, hence the RFC. :smiley:

I like this idea; there are a number of commands we provide ourselves that really do not require a factory.

We could likely handle this by doing a has() call before attempting a get(), and then directly instantiating the command if has() fails.

I’ve created an issue to track this.