GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( fe092f...f32e18 )
by Cretu
09:19
created

ReportHandler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handleReport() 0 12 3
1
<?php
2
3
namespace NotificationChannels\WebPush;
4
5
use Illuminate\Support\Facades\Log;
6
7
class ReportHandler implements ReportHandlerInterface
8
{
9
    /**
10
     * Handle a message sent report.
11
     *
12
     * @param \Minishlink\WebPush\MessageSentReport $report
13
     * @param \NotificationChannels\WebPush\PushSubscription $subscription
14
     * @return void
15
     */
16
    public function handleReport($report, $subscription)
17
    {
18
        if ($report->isSuccess()) {
19
            return;
20
        }
21
22
        Log::warning("Notification failed to sent for subscription {$subscription->endpoint}: {$report->getReason()}");
23
24
        if ($report->isSubscriptionExpired()) {
25
            $subscription->delete();
26
        }
27
    }
28
}
29