<?php

namespace App\Message\Handler\Typo3;

use App\Message\Command\Typo3\Typo3UpdateCommand;
use App\Service\Typo3\Typo3Service;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;

class Typo3UpdateCommandHandler implements MessageHandlerInterface
{
    public function __construct(
        private Typo3Service $typo3Service
    ) {}

    /**
     * @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface
     */
    public function __invoke(Typo3UpdateCommand $command) {
        $this->typo3Service->updateSite($command->getOrganizationId());
    }
}
