MetadataCollectorInterface.php 1013 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace Hyperf\Di;
  12. interface MetadataCollectorInterface
  13. {
  14. /**
  15. * Retrieve the metadata via key.
  16. * @param null|mixed $default
  17. */
  18. public static function get(string $key, $default = null);
  19. /**
  20. * Set the metadata to holder.
  21. * @param mixed $value
  22. */
  23. public static function set(string $key, $value): void;
  24. public static function clear(?string $key = null): void;
  25. /**
  26. * Serialize the all metadata to a string.
  27. */
  28. public static function serialize(): string;
  29. /**
  30. * Deserialize the serialized metadata and set the metadata to holder.
  31. */
  32. public static function deserialize(string $metadata): bool;
  33. /**
  34. * Return all metadata array.
  35. */
  36. public static function list(): array;
  37. }