for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Uxmp\Core\Component\Cli;
use Ahc\Cli\Input\Command;
use Ahc\Cli\IO\Interactor;
use Psr\Container\ContainerInterface;
use Uxmp\Core\Component\Catalog\Manage\CatalogDeleterInterface;
/**
* Provides a CLI command for catalog deletion
*/
final class CatalogDeletionCommand extends Command
{
public function __construct(
private readonly ContainerInterface $dic
) {
parent::__construct(
'catalog:delete',
'Deletes the catalog'
);
$this
->argument(
'<catalogId>',
'Id of the catalog'
)
->usage(
'<bold> $0 cd 666</end> <comment></end> ## Delete the catalog with id `666`<eol/>'
}
public function execute(?int $catalogId): void
$this->dic->get(CatalogDeleterInterface::class)->delete(new Interactor(), catalogId: (int) $catalogId);