<?php
declare(strict_types=1);

namespace Instinctor\Core;

if (!defined('ABSPATH')) { exit; }

/**
 * PlatformService — WordPress.org-distributed build.
 *
 * Stub: every method is inert. No remote pings, no license validation,
 * no announcement fetches. The standalone (full) build of the plugin
 * uses a different implementation that talks to platform.instinctor.com.
 */
class PlatformService
{
    public static function init(): void { /* no-op */ }
    public static function maybePing(): void { /* no remote calls */ }
    public static function maybeValidate(): void { /* no remote calls */ }
    public static function forceValidate(): void { /* no remote calls */ }
    public static function maybeFetchAnnouncements(): void { /* no remote calls */ }
    public static function renderAnnouncementNotices(): void { /* no output */ }

    public static function ajaxDismissAnnouncement(): void
    {
        wp_send_json_success();
    }

    public static function ajaxSubmitTicket(): void
    {
        wp_send_json_error(['message' => 'Support tickets are not available in this build.']);
    }

    public static function submitTicket(
        string $subject = '',
        string $body = '',
        string $email = '',
        string $name = '',
        array $context = []
    ): bool {
        return false;
    }

    public static function restDeliver(object $request): \WP_REST_Response
    {
        return new \WP_REST_Response(['success' => false, 'error' => 'not_available'], 404);
    }
}
