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
04:48
created

ApnTestNotification   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A via() 0 4 1
A toApn() 0 8 1
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(string $notificationTitle, string $notificationBody, int $badgeNumber, string $sound = 'default')
56
    {
57
        $this->notificationBody = $notificationBody;
58
        $this->notificationTitle = $notificationTitle;
59
        $this->badgeNumber = $badgeNumber;
60
        $this->sound = $sound;
61
    }
62
63
    /**
64
     * Set the notification route as 'ApnChannel'.
65
     *
66
     * @param mixed $notifiable
67
     * @return array
68
     */
69
    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...
70
    {
71
        return [ApnChannel::class];
72
    }
73
74
    /**
75
     * Use the APN service to send a push notification
76
     * to any iOS devices.
77
     *
78
     * @param $notifiable
79
     * @return ApnMessage
80
     */
81
    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...
82
    {
83
        return ApnMessage::create()
84
            ->badge($this->badgeNumber)
85
            ->title($this->notificationTitle)
86
            ->body($this->notificationBody)
87
            ->sound($this->sound);
88
    }
89
}