iampersistent/psr11-symfony-console

make a psr11 container available in the application for a console

Maintainers

Package info

github.com/iampersistent/psr11-symfony-console

pkg:composer/iampersistent/psr11-symfony-console

Statistics

Installs: 45

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.2 2020-07-11 21:07 UTC

This package is auto-updated.

Last update: 2026-03-12 09:26:24 UTC


README

Makes the PSR container available for Commands.

use IamPersistent\Console\Application;

$application = new Application();
$application->setContainer($container);
$application->add(new MyCommand());
$application->run();

In the command

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container = $this->getApplication()->getContainer();
    }