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.
Passed
Pull Request — master (#21)
by Cody
02:39
created

src/DiscordChannel.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace NotificationChannels\Discord;
4
5
use Illuminate\Notifications\Notification;
6
7
class DiscordChannel
8
{
9
    /**
10
     * @var \NotificationChannels\Discord\Discord
11
     */
12
    protected $discord;
13
14
    /**
15
     * @param \NotificationChannels\Discord\Discord $discord
16
     */
17 2
    public function __construct(Discord $discord)
18
    {
19 2
        $this->discord = $discord;
20 2
    }
21
22
    /**
23
     * Send the given notification.
24
     *
25
     * @param mixed $notifiable
26
     * @param \Illuminate\Notifications\Notification $notification
27
     *
28
     * @return array
29
     *
30
     * @throws \NotificationChannels\Discord\Exceptions\CouldNotSendNotification
31
     */
32 2
    public function send($notifiable, Notification $notification)
33
    {
34 2
        if (! $channel = $notifiable->routeNotificationFor('discord')) {
35 1
            return;
36
        }
37
38 1
        $message = $notification->toDiscord($notifiable);
1 ignored issue
show
The method toDiscord() does not exist on Illuminate\Notifications\Notification. It seems like you code against a sub-type of Illuminate\Notifications\Notification such as NotificationChannels\Dis...\Tests\TestNotification. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

38
        /** @scrutinizer ignore-call */ 
39
        $message = $notification->toDiscord($notifiable);
Loading history...
39
40 1
        return $this->discord->send($channel, [
41 1
            'content' => $message->body,
42 1
            'embed' => $message->embed,
43
        ]);
44
    }
45
}
46