$handler ) { $this->register_handler( $type, $handler ); } } /** * Registers a handler for a snippet type. * * @param string $type Handler key. * @param Snippet_Type_Handler $handler Handler class. * * @return void */ public function register_handler( string $type, Snippet_Type_Handler $handler ): void { $this->handlers[ $type ] = $handler; } /** * Gets the handler for a snippet type. * * @param string $type Handler key. * * @return Snippet_Type_Handler|null */ public function get_handler( string $type ): ?Snippet_Type_Handler { return $this->handlers[ $type ] ?? null; } }