namespace = $namespace; } public function register(rest_endpoint $endpoint) : self { $parameters = [ 'methods' => $endpoint->get_method(), 'callback' => [$endpoint, 'action'] ]; register_rest_route( $this->get_namespace(), $endpoint->get_route(), $parameters ); return $this; } public function get_namespace() : string { return $this->namespace; } private string $namespace; }