hooks = $hooks; $this->registry = $registry; $this->catalog = $catalog; } /** * Queues the REST registration via the hook loader. * * @return void */ public function register(): void { $this->hooks->add_action( 'rest_api_init', array( $this, 'register_routes' ) ); } /** * Registers the REST controllers. * * @return void */ public function register_routes(): void { ( new ConditionsController( $this->registry, $this->catalog ) )->register_routes(); } }