VariablesInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace Dotenv\Environment;
  3. use ArrayAccess;
  4. /**
  5. * This environment variables interface.
  6. */
  7. interface VariablesInterface extends ArrayAccess
  8. {
  9. /**
  10. * Determine if the environment is immutable.
  11. *
  12. * @return bool
  13. */
  14. public function isImmutable();
  15. /**
  16. * Tells whether environment variable has been defined.
  17. *
  18. * @param string $name
  19. *
  20. * @return bool
  21. */
  22. public function has($name);
  23. /**
  24. * Get an environment variable.
  25. *
  26. * @param string $name
  27. *
  28. * @throws \InvalidArgumentException
  29. *
  30. * @return string|null
  31. */
  32. public function get($name);
  33. /**
  34. * Set an environment variable.
  35. *
  36. * @param string $name
  37. * @param string|null $value
  38. *
  39. * @throws \InvalidArgumentException
  40. *
  41. * @return void
  42. */
  43. public function set($name, $value = null);
  44. /**
  45. * Clear an environment variable.
  46. *
  47. * @param string $name
  48. *
  49. * @throws \InvalidArgumentException
  50. *
  51. * @return void
  52. */
  53. public function clear($name);
  54. }