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.

ReportHandler::handleReport()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 3
dl 0
loc 12
ccs 7
cts 7
cp 1
crap 3
rs 9.8666
c 0
b 0
f 0
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
        Log::warning("Notification failed to sent for subscription {$subscription->endpoint}: {$report->getReason()}");
24
25 1
        if ($report->isSubscriptionExpired()) {
26 1
            $subscription->delete();
27
        }
28 1
    }
29
}
30