1 | <?php |
||
25 | class NotificationsService |
||
26 | { |
||
27 | /** |
||
28 | * @var EmailService |
||
29 | */ |
||
30 | protected $emailService; |
||
31 | |||
32 | /** |
||
33 | * @var SystemPreferencesService |
||
34 | */ |
||
35 | protected $systemPreferences; |
||
36 | |||
37 | /** |
||
38 | * @var TemplatesService |
||
39 | */ |
||
40 | protected $templatesService; |
||
41 | |||
42 | /** |
||
43 | * @var PlaceholdersService |
||
44 | */ |
||
45 | protected $placeholdersService; |
||
46 | |||
47 | /** |
||
48 | * @var EntityManager |
||
49 | */ |
||
50 | protected $em; |
||
51 | |||
52 | protected $dispatcher; |
||
53 | |||
54 | /** |
||
55 | * @param EmailService $emailService |
||
56 | * @param SystemPreferencesService $systemPreferences |
||
57 | * @param TemplatesService $templatesService |
||
58 | * @param PlaceholdersService $placeholdersService |
||
59 | * @param EntityManager $em |
||
60 | * @param ContainerAwareEventDispatcher $dispatcher |
||
61 | */ |
||
62 | public function __construct( |
||
77 | |||
78 | /** |
||
79 | * Sends email notifications. |
||
80 | * |
||
81 | * @param string $code Email message type |
||
82 | * @param Newscoop\Entity\User $user User object |
||
|
|||
83 | * @param PaywallBundle\Entity\UserSubscription $userSubscription User's subscription |
||
84 | */ |
||
85 | public function sendNotification($code, array $recipients = array(), array $data = array()) |
||
125 | |||
126 | private function loadProperMessageTemplateBy($code) |
||
160 | |||
161 | /** |
||
162 | * Sets notify sent flag for given user subscription. |
||
163 | * Level one of the notifications, for instance, |
||
164 | * sends notifications 7 days before expiration. |
||
165 | * |
||
166 | * @param UserSubscription $subscription User subscription |
||
167 | * @param \DateTime $datetime Date time when notify has been sent |
||
168 | */ |
||
169 | public function setSentDateTimeOnLevelOne(UserSubscription $subscription, $datetime = null) |
||
174 | |||
175 | /** |
||
176 | * Sets notify sent flag for given user subscription. |
||
177 | * Level two of the notifications, for instance, |
||
178 | * sends notifications 3 days before expiration. |
||
179 | * |
||
180 | * @param UserSubscription $subscription User subscription |
||
181 | * @param \DateTime $datetime Date time when notify has been sent |
||
182 | */ |
||
183 | public function setSentDateTimeOnLevelTwo(UserSubscription $subscription, $datetime = null) |
||
188 | |||
189 | /** |
||
190 | * Processes expiring subscriptions and sends email |
||
191 | * notifications to users. |
||
192 | * |
||
193 | * @param \DateTime $now Current date time |
||
194 | * @param int $subscriptionsCount Subscriptions count |
||
195 | */ |
||
196 | public function processExpiringSubscriptions($now, $notify, $count = 0, $days = 7) |
||
214 | |||
215 | /** |
||
216 | * Gets expiring subscriptions count. |
||
217 | * |
||
218 | * @param \DateTime $now Current date time |
||
219 | * |
||
220 | * @return int |
||
221 | */ |
||
222 | public function getExpiringSubscriptionsCount($now, $notify, $days = 7) |
||
229 | |||
230 | private function dispatchNotificationSend($expiringSubscriptions) |
||
239 | } |
||
240 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.