<?php

namespace App\Domain\Scraping\Infrastructure\ApiPlatform\State\Processor;

use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProcessorInterface;
use App\Domain\Scraping\Application\Command\CheckAllScrapersHealth;
use App\Domain\Scraping\Application\CommandHandler\CheckAllScrapersHealthHandler;

readonly class CheckAllScrapersHealthStateProcessor implements ProcessorInterface
{
    public function __construct(
        private CheckAllScrapersHealthHandler $handler,
    ) {
    }

    public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): null
    {
        $this->handler->handle(new CheckAllScrapersHealth());

        return null;
    }
}
