iampersistent / psr11-symfony-console
make a psr11 container available in the application for a console
v1.2
2020-07-11 21:07 UTC
Requires
- php: >=7.1
- psr/container: ^1.0
- symfony/console: ^4.0 || ^5.0
This package is auto-updated.
Last update: 2024-12-12 07:04:48 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(); }