| 1 | <?php |
||
| 8 | class Note implements \JsonSerializable |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var NoteId |
||
| 12 | */ |
||
| 13 | private $id; |
||
| 14 | /** |
||
| 15 | * @var UserId |
||
| 16 | */ |
||
| 17 | private $userId; |
||
| 18 | /** |
||
| 19 | * @var CategoryId |
||
| 20 | */ |
||
| 21 | private $categoryId; |
||
| 22 | /** |
||
| 23 | * @var string[] |
||
| 24 | */ |
||
| 25 | private $tags; |
||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | private $title; |
||
| 30 | /** |
||
| 31 | * @var string |
||
| 32 | */ |
||
| 33 | private $content; |
||
| 34 | |||
| 35 | public function __construct() |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return UserId |
||
| 41 | */ |
||
| 42 | public function getUserId() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param UserId $userId |
||
| 49 | * @return Note |
||
| 50 | */ |
||
| 51 | public function setUserId(UserId $userId) |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return CategoryId |
||
| 60 | */ |
||
| 61 | public function getCategoryId() |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @param CategoryId $categoryId |
||
| 68 | * @return Note |
||
| 69 | */ |
||
| 70 | public function setCategoryId(CategoryId $categoryId) |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @return \string[] |
||
|
|
|||
| 79 | */ |
||
| 80 | public function getTags() |
||
| 84 | |||
| 85 | /** |
||
| 86 | * @param \string[] $tags |
||
| 87 | * @return Note |
||
| 88 | */ |
||
| 89 | public function setTags(array $tags) |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @return string |
||
| 98 | */ |
||
| 99 | public function getTitle() |
||
| 103 | |||
| 104 | /** |
||
| 105 | * @param string $title |
||
| 106 | * @return Note |
||
| 107 | */ |
||
| 108 | public function setTitle(string $title) |
||
| 114 | |||
| 115 | /** |
||
| 116 | * @return string |
||
| 117 | */ |
||
| 118 | public function getContent() |
||
| 122 | |||
| 123 | /** |
||
| 124 | * @param string $content |
||
| 125 | * @return Note |
||
| 126 | */ |
||
| 127 | public function setContent(string $content) |
||
| 133 | |||
| 134 | function jsonSerialize() |
||
| 144 | |||
| 145 | /** |
||
| 146 | * @return NoteId |
||
| 147 | */ |
||
| 148 | public function getId() |
||
| 152 | |||
| 153 | /** |
||
| 154 | * @param NoteId $id |
||
| 155 | * @return Note |
||
| 156 | */ |
||
| 157 | public function setId(NoteId $id) |
||
| 163 | } |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.