<?php

declare(strict_types=1);

namespace App\Framework\ErrorReporting;

use Throwable;

/**
 * Null Object implementation for ErrorReporter
 *
 * Used when error reporting is disabled or unavailable.
 * All operations are no-ops that return empty/default values.
 */
final readonly class NullErrorReporter implements ErrorReporterInterface
{
    public function reportThrowable(
        Throwable $throwable,
        string $level = 'error',
        array $context = []
    ): string {
        // No-op: Error reporting is disabled
        return 'null-report-' . bin2hex(random_bytes(8));
    }

    public function reportError(
        string $level,
        string $message,
        array $context = [],
        ?Throwable $exception = null
    ): string {
        // No-op: Error reporting is disabled
        return 'null-report-' . bin2hex(random_bytes(8));
    }

    public function report(ErrorReport $report): string
    {
        // No-op: Error reporting is disabled
        return $report->id;
    }

    public function getReport(string $reportId): ?ErrorReport
    {
        return null;
    }

    public function getRecentReports(int $limit = 100, int $offset = 0): array
    {
        return [];
    }
}
