<?php


namespace App\Command;


use App\Service\KeyLighterVersioner;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class KeyLighterUpdate extends Command
{
    /** @var \App\Service\KeyLighterVersioner */
    private $versioner;

    /**
     * KeyLighterUpdate constructor.
     *
     * @param \App\Service\KeyLighterVersioner $versioner
     */
    public function __construct(KeyLighterVersioner $versioner)
    {
        $this->versioner = $versioner;

        parent::__construct('keylighter:update');
    }

    protected function configure()
    {
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $this->versioner->updateAll();

        return 0;
    }
}
