<?php

namespace PluginsNameSpaces\Hooks\Handlers;

use PluginsNameSpaces\App;
use PluginsNameSpaces\Framework\Http\Router;

/**
 * Loads the plugin's REST route definitions and registers them
 * with WordPress through the framework Router.
 */
class RestRouteHandler
{
    /**
     * Wire the router.
     *
     * @return void
     */
    public function register()
    {
        $router = new Router(
            App::container(),
            App::config('app.rest_namespace'),
            App::config('app.rest_version')
        );

        $router->register(__CONST_PREFIX___PATH . 'app/Http/Routes/api.php');
    }
}
