<?php namespace Tussendoor\Reloadify\Http\Endpoints;

class Server
{
    
    public function register()
    {
        add_filter('woocommerce_rest_api_get_rest_namespaces', [$this, 'addCustomNamespaces']);
    }
    
    /**
     * Add custom namespaces to the WC V3 controllers
     * Our namespaces contain custom endpoints
     *
     * @param  array $controllers
     * @return array
     */
    public function addCustomNamespaces(array $controllers) : array
    {
        $controllers['wc/v3']['reloadify/shopping_carts'] = AbandonedCartEndpoint::class;
        $controllers['wc/v3']['reloadify/info'] = PluginInfoEndpoint::class;
    
        return $controllers;
    }

}