Storage.php 816 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\App\Helpers;
  3. /**
  4. *
  5. * Created by PhpStorm.
  6. * User: ThurData
  7. * Date: 05.09.19
  8. * Time: 14:14
  9. * Class Storage
  10. */
  11. class Storage
  12. {
  13. /**
  14. * @var array
  15. */
  16. protected $data = [];
  17. /**
  18. * @param $key
  19. * @param $value
  20. * @return $this
  21. */
  22. public function set($key, $value)
  23. {
  24. $this->data[$key] = $value;
  25. return $this;
  26. }
  27. /**
  28. * @param $key
  29. * @return bool
  30. */
  31. public function exists($key)
  32. {
  33. return isset($this->data[$key]);
  34. }
  35. /**
  36. * @param $key
  37. */
  38. public function remove($key)
  39. {
  40. unset($this->data[$key]);
  41. }
  42. /**
  43. * @param $key
  44. * @return mixed
  45. */
  46. public function get($key)
  47. {
  48. return $this->data[$key];
  49. }
  50. }