settings = $settings; $this->notifier = $notifier; } public function register(): void { $this->route('/notifications', 'GET', fn () => $this->settings->get()); $this->route('/notifications', 'POST', fn (\WP_REST_Request $r) => $this->settings->save($r->get_json_params())); $this->route('/notifications/test', 'POST', fn () => $this->notifier->test()); } }