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::handleReport()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3.1406

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 6
cts 8
cp 0.75
rs 9.8333
c 0
b 0
f 0
cc 3
nc 3
nop 3
crap 3.1406
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