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 (#66)
by
unknown
03:11
created

ApnTestNotification::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 11
cp 0
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 4
crap 2
1
<?php
2
3
namespace NotificationChannels\Apn\Notifications;
4
5
use Illuminate\Bus\Queueable;
6
use NotificationChannels\Apn\ApnChannel;
7
use NotificationChannels\Apn\ApnMessage;
8
use Illuminate\Notifications\Notification;
9
use Illuminate\Contracts\Queue\ShouldQueue;
10
11
class ApnTestNotification extends Notification
12
{
13
    use Queueable;
14
15
    /**
16
     * The body of the test notification that will
17
     * be sent.
18
     *
19
     * @var string
20
     */
21
    private $notificationBody;
22
23
    /**
24
     * The title of the test notification that will
25
     * be sent.
26
     *
27
     * @var string
28
     */
29
    private $notificationTitle;
30
31
    /**
32
     * The badge number that will be sent with the
33
     * notification.
34
     *
35
     * @var integer
36
     */
37
    private $badgeNumber;
38
39
    /**
40
     * The sound that will be played when the device
41
     * receives the notification.
42
     *
43
     * @var string
44
     */
45
    private $sound;
46
47
    /**
48
     * NewChatMessage constructor.
49
     *
50
     * @param string $notificationTitle
51
     * @param string $notificationBody
52
     * @param int $badgeNumber
53
     * @param string $sound
54
     */
55
    public function __construct(
56
        string $notificationTitle,
57
        string $notificationBody,
58
        int $badgeNumber,
59
        string $sound = 'default'
60
    ) {
61
        $this->notificationBody = $notificationBody;
62
        $this->notificationTitle = $notificationTitle;
63
        $this->badgeNumber = $badgeNumber;
64
        $this->sound = $sound;
65
    }
66
67
    /**
68
     * Set the notification route as 'ApnChannel'.
69
     *
70
     * @param mixed $notifiable
71
     * @return array
72
     */
73
    public function via($notifiable): array
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...
74
    {
75
        return [ApnChannel::class];
76
    }
77
78
    /**
79
     * Use the APN service to send a push notification
80
     * to any iOS devices.
81
     *
82
     * @param $notifiable
83
     * @return ApnMessage
84
     */
85
    public function toApn($notifiable): ApnMessage
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...
86
    {
87
        return ApnMessage::create()
88
            ->badge($this->badgeNumber)
89
            ->title($this->notificationTitle)
90
            ->body($this->notificationBody)
91
            ->sound($this->sound);
92
    }
93
}
94