*/ final class PingHandler implements MethodHandlerInterface { public function supports(HasMethodInterface $message): bool { return $message instanceof PingRequest; } public function handle(PingRequest|HasMethodInterface $message): Response { \assert($message instanceof PingRequest); return new Response($message->getId(), new EmptyResult()); } }