<?php

declare(strict_types=1);

namespace Apexl\Io\Logger\Notifiers;

use Apexl\Io\Logger\Interfaces\LoggerInterface;
use Apexl\Io\Notifier\Interfaces\NotifierInterface;
use Apexl\Io\Notifier\Notifiers\Notifier;

/**
 * @TODO Lift this out into a separate module, requiring `apexl/io-logger` and `apexl/io-notifer`
 */
abstract class LoggerNotifier extends Notifier implements NotifierInterface
{
    protected LoggerInterface $logger;
    abstract protected function message(): string;

    public function __construct()
    {
        parent::__construct();
    }

    public function send(): void
    {
        $this->logger->debug($this->message(), $this->context());
    }

    protected function context(): array
    {
        return [];
    }
}
