1 | <?php |
||
19 | class Notification implements Model |
||
20 | { |
||
21 | const NOTIFICATION_TYPES = [ |
||
22 | 'accounts_associated', |
||
23 | 'badge_earned', |
||
24 | 'bounty_expired', |
||
25 | 'bounty_expires_in_one_day', |
||
26 | 'bounty_expires_in_three_days', |
||
27 | 'bounty_period_started', |
||
28 | 'edit_suggested', |
||
29 | 'generic', |
||
30 | 'moderator_message', |
||
31 | 'new_privileges', |
||
32 | 'post_migrated', |
||
33 | 'profile_activity', |
||
34 | 'registration_reminder', |
||
35 | 'reputation_bonus', |
||
36 | 'substantive_edit', |
||
37 | ]; |
||
38 | |||
39 | protected $body; |
||
40 | protected $creationDate; |
||
41 | protected $isUnread; |
||
42 | protected $notificationType; |
||
43 | protected $postId; |
||
44 | protected $site; |
||
45 | |||
46 | public static function fromProperties( |
||
65 | |||
66 | public static function fromJson(array $data) |
||
83 | |||
84 | public function setBody($body) |
||
90 | |||
91 | public function getBody() |
||
95 | |||
96 | public function setCreationDate(\DateTimeInterface $creationDate = null) |
||
102 | |||
103 | public function getCreationDate() |
||
107 | |||
108 | public function setUnread($isUnread) |
||
114 | |||
115 | public function isUnread() |
||
119 | |||
120 | public function setNotificationType($notificationType) |
||
128 | |||
129 | public function getNotificationType() |
||
133 | |||
134 | public function setPostId($postId) |
||
140 | |||
141 | public function getPostId() |
||
145 | |||
146 | public function setSite(Site $site = null) |
||
152 | |||
153 | public function getSite() |
||
157 | } |
||
158 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.