iampersistent/psr11-symfony-console

make a psr11 container available in the application for a console

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

This package is auto-updated.

Last update: 2024-04-12 05:30:45 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();
    }