Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php declare(strict_types=1);
  2. namespace MyTest;
  3. /**
  4. * @ValueObject
  5. */
  6. class MyClass {
  7. /**
  8. * @var int
  9. * @Setter @Getter
  10. */
  11. private $age;
  12. /**
  13. * @var int[]
  14. */
  15. private $days = [];
  16.  
  17. public function setAge(int $age) : void
  18. {
  19. $this->age = $age;
  20. }
  21.  
  22. public function getAge() : int
  23. {
  24. return $this->age;
  25. }
  26.  
  27. public function addDay(int $day) : void
  28. {
  29. //...
  30. }
  31.  
  32. public function removeDay(int $day) : void
  33. {
  34. // ...
  35. }
  36.  
  37. /**
  38. * @return int[]
  39. */
  40. public function getDays() : array
  41. {
  42. // ...
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement