<?php

namespace KupShop\KafkaBundle\Inspections;

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

class ModuleInspection extends Inspection implements CompileInspectionInterface
{
    /**
     * @return InspectionMessage[]|null
     */
    public function runInspection(): ?array
    {
        $errors = [];

        if (!\extension_loaded('rdkafka')) {
            $errors[] = new SimpleMessage('"rdkafka" extension is not installed.');
        }

        return $errors;
    }
}
