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 ( 11f95b...c6944f )
by Freek
02:24
created

SiteDown   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 35
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A toMail() 0 9 1
A toSlack() 0 6 1
A setEvent() 0 6 1
1
<?php
2
3
namespace Spatie\UptimeMonitor\Notifications\Notifications;
4
5
use Illuminate\Notifications\Messages\MailMessage;
6
use Illuminate\Notifications\Messages\SlackMessage;
7
use Illuminate\Notifications\Notification;
8
use Spatie\UptimeMonitor\Events\SiteDown as SiteDownEvent;
9
10
class SiteDown extends Notification
11
{
12
    /** @var \Spatie\UptimeMonitor\Events\SiteDown */
13
    protected $event;
14
15
    /**
16
     * Get the mail representation of the notification.
17
     *
18
     * @param  mixed $notifiable
19
     * @return \Illuminate\Notifications\Messages\MailMessage
20
     */
21
    public function toMail($notifiable)
0 ignored issues
show
Unused Code introduced by
The parameter $notifiable is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
22
    {
23
        $mailMessage = (new MailMessage)
24
            ->error()
25
            ->subject("Site {$this->event->uptimeMonitor->url} is down")
26
            ->line("Site is down");
27
28
        return $mailMessage;
29
    }
30
31
    public function toSlack($notifiable)
0 ignored issues
show
Unused Code introduced by
The parameter $notifiable is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
32
    {
33
        return (new SlackMessage)
34
            ->error()
35
            ->content("Site {$this->event->uptimeMonitor->url} is down");
36
    }
37
38
    public function setEvent(SiteDownEvent $event)
39
    {
40
        $this->event = $event;
41
42
        return $this;
43
    }
44
}
45