<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Event\Queue\Drivers;

use PpPhp\Core\Platform\Event\Queue\Contracts\QueueDriverInterface;
use PpPhp\Core\Platform\Event\Queue\DeferredEvent;
use PpPhp\Core\Platform\Event\Queue\QueueSnapshot;
use PpPhp\Core\Platform\Event\Queue\QueueStatistics;

final class NullQueueDriver implements QueueDriverInterface
{
    public function name(): string { return 'null'; }
    public function push(DeferredEvent $event): string { return $event->id(); }
    public function pop(): ?DeferredEvent { return null; }
    public function peek(): ?DeferredEvent { return null; }
    public function cancel(string $id): bool { return false; }
    public function clear(): void {}
    public function all(): array { return []; }
    public function restore(QueueSnapshot $snapshot): void {}
    public function size(): int { return 0; }
    public function statistics(): QueueStatistics { return new QueueStatistics($this->name(), 0, 0); }
}
