ConfigurationInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /*
  3. * This file is part of Alchemy\BinaryDriver.
  4. *
  5. * (c) Alchemy <info@alchemy.fr>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Alchemy\BinaryDriver;
  11. interface ConfigurationInterface extends \ArrayAccess, \IteratorAggregate
  12. {
  13. /**
  14. * Returns the value given a key from configuration
  15. *
  16. * @param string $key
  17. * @param mixed $default The default value in case the key does not exist
  18. *
  19. * @return mixed
  20. */
  21. public function get($key, $default = null);
  22. /**
  23. * Set a value to configuration
  24. *
  25. * @param string $key The key
  26. * @param mixed $value The value corresponding to the key
  27. */
  28. public function set($key, $value);
  29. /**
  30. * Tells if Configuration contains `$key`
  31. *
  32. * @param string $key
  33. *
  34. * @return Boolean
  35. */
  36. public function has($key);
  37. /**
  38. * Removes a value given a key
  39. *
  40. * @param string $key
  41. *
  42. * @return mixed The previous value
  43. */
  44. public function remove($key);
  45. /**
  46. * Returns all values set in the configuration
  47. *
  48. * @return array
  49. */
  50. public function all();
  51. }