Reference.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. if ( !class_exists('Puc_v4p11_Vcs_Reference', false) ):
  3. /**
  4. * This class represents a VCS branch or tag. It's intended as a read only, short-lived container
  5. * that only exists to provide a limited degree of type checking.
  6. *
  7. * @property string $name
  8. * @property string|null version
  9. * @property string $downloadUrl
  10. * @property string $updated
  11. *
  12. * @property string|null $changelog
  13. * @property int|null $downloadCount
  14. */
  15. class Puc_v4p11_Vcs_Reference {
  16. private $properties = array();
  17. public function __construct($properties = array()) {
  18. $this->properties = $properties;
  19. }
  20. /**
  21. * @param string $name
  22. * @return mixed|null
  23. */
  24. public function __get($name) {
  25. return array_key_exists($name, $this->properties) ? $this->properties[$name] : null;
  26. }
  27. /**
  28. * @param string $name
  29. * @param mixed $value
  30. */
  31. public function __set($name, $value) {
  32. $this->properties[$name] = $value;
  33. }
  34. /**
  35. * @param string $name
  36. * @return bool
  37. */
  38. public function __isset($name) {
  39. return isset($this->properties[$name]);
  40. }
  41. }
  42. endif;