1<?php 2 3declare(strict_types=1); 4 5namespace JMS\Serializer\Handler; 6 7/** 8 * Handler Registry Interface. 9 * 10 * @author Johannes M. Schmitt <schmittjoh@gmail.com> 11 */ 12interface HandlerRegistryInterface 13{ 14 public function registerSubscribingHandler(SubscribingHandlerInterface $handler): void; 15 16 /** 17 * Registers a handler in the registry. 18 * 19 * @param int $direction one of the GraphNavigatorInterface::DIRECTION_??? constants 20 * @param object|callable $handler function(visitor, mixed $data, array $type): mixed 21 */ 22 public function registerHandler(int $direction, string $typeName, string $format, $handler): void; 23 24 /** 25 * @param int $direction one of the GraphNavigatorInterface::DIRECTION_??? constants 26 * 27 * @return callable|object 28 */ 29 public function getHandler(int $direction, string $typeName, string $format); 30} 31