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
Pull Request — master (#128)
by
unknown
05:11 queued 04:06
created

ReportHandler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 24
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handleReport() 0 13 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
     * @param \NotificationChannels\WebPush\WebPushMessage $message
15
     * @return void
16
     */
17 2
    public function handleReport($report, $subscription, $message)
18
    {
19 2
        if ($report->isSuccess()) {
20 2
            return;
21
        }
22
23 1
        if ($report->isSubscriptionExpired()) {
24 1
            $subscription->delete();
25
26 1
            return;
27
        }
28
        Log::warning("Notification failed to sent for subscription {$subscription->endpoint}: {$report->getReason()}");
29
    }
30
}
31