handlers[$type] = $handler; return $this; } /** * @throws MicropubHandlerException */ public function getHandler(string $type): MicropubHandlerInterface { if (! isset($this->handlers[$type])) { throw new MicropubHandlerException("No handler registered for '{$type}'"); } return $this->handlers[$type]; } }