<?php

declare(strict_types=1);

namespace KupShop\ReservationBundle\Inspections;

use KupShop\SystemInspectionBundle\Inspections\Compile\CompileInspectionInterface;
use KupShop\SystemInspectionBundle\Inspections\Inspection;
use KupShop\SystemInspectionBundle\InspectionWriters\MessageTypes\SimpleMessage;

class ReservationInspection extends Inspection implements CompileInspectionInterface
{
    public function runInspection(): ?array
    {
        $errors = [];

        if (!findModule(\Modules::SELLERS)) {
            $errors[] = new SimpleMessage(
                sprintf('Module SELLERS is required when reservations are enabled!')
            );
        }

        return $errors;
    }
}
