<?php

declare(strict_types=1);

namespace KupShop\ConvertorsBundle\EventSubscribers;

use KupShop\ConvertorsBundle\Utils\ConvertorsUtil;
use KupShop\KupShopBundle\Event\CronEvent;

class CronSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
{
    /** @required  */
    public ConvertorsUtil $convertorsUtil;

    public static function getSubscribedEvents()
    {
        return [
            CronEvent::RUN_EXPENSIVE => [
                ['generateCache', 200],
            ],
        ];
    }

    public function generateCache(CronEvent $event)
    {
        $this->convertorsUtil->generateCache();
    }
}
