Skip to content

DI injection for commands? #46

@matak

Description

@matak

Nebyl by tady nějaký injecting? Toto DI není úplně ok ne? od doby co global context je fuj?

class SendNewslettersCommand extends Command
{
    protected function configure()
    {
        $this->setName('app:newsletter')
            ->setDescription('Sends the newsletter');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $newsletterSender = $this->getHelper('container')->getByType('Models\NewsletterSender');

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions