HandlerRegistryInterface.php 1.0 KB

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