Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
NotificationRequestJob | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
run | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\Notifications\Push; |
4 | |
5 | use Job; |
6 | use MediaWiki\Extension\Notifications\Services; |
7 | |
8 | class NotificationRequestJob extends Job { |
9 | |
10 | /** |
11 | * @return bool success |
12 | */ |
13 | public function run(): bool { |
14 | $centralId = $this->params['centralId']; |
15 | $echoServices = Services::getInstance(); |
16 | $subscriptionManager = $echoServices->getPushSubscriptionManager(); |
17 | $subscriptions = $subscriptionManager->getSubscriptionsForUser( $centralId ); |
18 | if ( count( $subscriptions ) === 0 ) { |
19 | return true; |
20 | } |
21 | $serviceClient = $echoServices->getPushNotificationServiceClient(); |
22 | $serviceClient->sendCheckEchoRequests( $subscriptions ); |
23 | return true; |
24 | } |
25 | |
26 | } |