<?php

declare(strict_types=1);

namespace CalendarPlugin\Infrastructure\WordPress;

use CalendarPlugin\Contracts\HttpAdapterInterface;

final class WordPressHttpAdapter implements HttpAdapterInterface
{
    public function addAction(string $hook, callable $callback, int $priority = 10, int $acceptedArgs = 1): void
    {
        add_action($hook, $callback, $priority, $acceptedArgs);
    }

    public function addShortcode(string $tag, callable $callback): void
    {
        add_shortcode($tag, $callback);
    }

    public function registerRestRoute(string $namespace, string $route, array $args): void
    {
        register_rest_route($namespace, $route, $args);
    }
}
