<?php

use App\Core\Database;

if (!function_exists('has_conflict')) {
    function has_conflict(int $reviewerId, int $authorId): bool
    {
        $db = Database::getInstance();

        $stmt = $db->prepare("
            SELECT id FROM reviewer_conflicts
            WHERE reviewer_id = ?
              AND author_id = ?
        ");

        $stmt->execute([$reviewerId, $authorId]);
        return (bool) $stmt->fetch();
    }
}
