Skip to content

Commit

Permalink
Update console command definition to SF 4.4 standards
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitri Perunov committed Feb 19, 2021
1 parent 6ae2030 commit 3835287
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions src/Cli/GenerateInvoicesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

final class GenerateInvoicesCommand extends Command
{
/** @var string */
protected static $defaultName = 'sylius-invoicing:generate-invoices';

/** @var MassInvoicesCreatorInterface */
private $massInvoicesCreator;

Expand All @@ -22,10 +25,15 @@ public function __construct(
MassInvoicesCreatorInterface $massInvoicesCreator,
OrderRepositoryInterface $orderRepository
) {
parent::__construct('sylius-invoicing:generate-invoices');

$this->massInvoicesCreator = $massInvoicesCreator;
$this->orderRepository = $orderRepository;

parent::__construct();
}

protected function configure(): void
{
$this->setDescription('Generates invoices for orders placed before InvoicingPlugin installation');
}

public function execute(InputInterface $input, OutputInterface $output): int
Expand All @@ -43,9 +51,4 @@ public function execute(InputInterface $input, OutputInterface $output): int

return 0;
}

protected function configure(): void
{
$this->setDescription('Generates invoices for orders placed before InvoicingPlugin installation');
}
}
2 changes: 1 addition & 1 deletion src/Resources/config/services/cli.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<service id="sylius_invoicing_plugin.cli.generate_invoices" class="Sylius\InvoicingPlugin\Cli\GenerateInvoicesCommand">
<argument type="service" id="sylius_invoicing_plugin.creator.mass_invoices" />
<argument type="service" id="sylius.repository.order" />
<tag name="console.command" command="sylius-invoicing:generate-invoices" />
<tag name="console.command" />
</service>
</services>
</container>

0 comments on commit 3835287

Please sign in to comment.