ConfigInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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\Contract;
  12. interface ConfigInterface
  13. {
  14. /**
  15. * Finds an entry of the container by its identifier and returns it.
  16. *
  17. * @param string $key identifier of the entry to look for
  18. * @param mixed $default default value of the entry when does not found
  19. * @return mixed entry
  20. */
  21. public function get(string $key, $default = null);
  22. /**
  23. * Returns true if the container can return an entry for the given identifier.
  24. * Returns false otherwise.
  25. *
  26. * @param string $keys identifier of the entry to look for
  27. * @return bool
  28. */
  29. public function has(string $keys);
  30. /**
  31. * Set a value to the container by its identifier.
  32. *
  33. * @param string $key identifier of the entry to set
  34. * @param mixed $value the value that save to container
  35. */
  36. public function set(string $key, $value);
  37. }