autowp/autowp

View on GitHub
module/Application/src/Command/SpecsRefreshUsersStatCommand.php

Summary

Maintainability
A
1 hr
Test Coverage
<?php

namespace Application\Command;

use Application\Service\SpecificationsService;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class SpecsRefreshUsersStatCommand extends Command
{
    private SpecificationsService $specsService;

    /** @var string|null The default command name */
    protected static $defaultName = 'specs-refresh-users-stat';

    protected function configure(): void
    {
        $this->setName(self::$defaultName);
    }

    public function __construct(string $name, SpecificationsService $specsService)
    {
        parent::__construct($name);

        $this->specsService = $specsService;
    }

    /**
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $this->specsService->refreshUsersConflictsStat();

        return 0;
    }
}