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 ( b45687...2691f8 )
by Pascal
01:21
created

SendRecoveredNotification::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Pbmedia\ApiHealth\Listeners;
4
5
use Pbmedia\ApiHealth\Checkers\CheckerSendsNotifications;
6
use Pbmedia\ApiHealth\Events\CheckerHasRecovered;
7
8
class SendRecoveredNotification
9
{
10
    use SendsNotifications;
11
12
    /**
13
     * Sends the recovered notification if needed.
14
     *
15
     * @param  \Pbmedia\ApiHealth\Events\CheckerHasRecovered $event
16
     */
17
    public function handle(CheckerHasRecovered $event)
18
    {
19
        $checker = $event->checker;
20
21
        if (!$checker instanceof CheckerSendsNotifications) {
22
            return;
23
        }
24
25
        $notificationClass = $checker->recoveredNotificationClass();
26
27
        $this->sendNotification(
28
            new $notificationClass($checker, $event->failedData)
29
        );
30
    }
31
}
32