Issues (63)

Branch: master

app/Notifications/InvitationMail.php (4 issues)

1
<?php
2
3
namespace Thinktomorrow\Chief\App\Notifications;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Contracts\Queue\ShouldQueue;
7
use Illuminate\Notifications\Messages\MailMessage;
8
use Illuminate\Notifications\Notification;
9
use Illuminate\Queue\SerializesModels;
10
use Thinktomorrow\Chief\Admin\Users\Invites\Invitation;
11
12
class InvitationMail extends Notification implements ShouldQueue
13
{
14
    use Queueable;
15
    use SerializesModels;
0 ignored issues
show
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by Thinktomorrow\Chief\App\...ications\InvitationMail: $collectionClass, $relations, $class, $keyBy
Loading history...
16
17
    public $invitation;
18
19
    public function __construct(Invitation $invitation)
20
    {
21
        $this->invitation = $invitation;
22
    }
23
24
    /**
25
     * @return string[]
26
     *
27
     * @psalm-return array{0: string}
28
     */
29
    public function via($notifiable): array
0 ignored issues
show
The parameter $notifiable is not used and could be removed. ( Ignorable by Annotation )

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

29
    public function via(/** @scrutinizer ignore-unused */ $notifiable): array

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

Loading history...
30
    {
31
        return ['mail'];
32
    }
33
34
    /**
35
     * Get the mail representation of the notification.
36
     *
37
     * @param  mixed $notifiable
38
     * @return \Illuminate\Notifications\Messages\MailMessage
39
     */
40
    public function toMail($notifiable)
0 ignored issues
show
The parameter $notifiable is not used and could be removed. ( Ignorable by Annotation )

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

40
    public function toMail(/** @scrutinizer ignore-unused */ $notifiable)

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

Loading history...
41
    {
42
        return (new MailMessage())
43
            ->subject('Uitnodiging tot Chief')
44
            ->from(chiefSetting('from_email', null, chiefSetting('contact_email')), chiefSetting('from_name', null, chiefSetting('contact_name')))
45
            ->view('chief::mails.invitation', [
46
                'invitee' => $this->invitation->invitee,
47
                'inviter' => $this->invitation->inviter,
48
                'accept_url' => $this->invitation->acceptUrl(),
49
                'deny_url' => $this->invitation->denyUrl(),
50
            ]);
51
    }
52
53
    /**
54
     * Get the array representation of the notification.
55
     *
56
     * @param  mixed $notifiable
57
     * @return array
58
     */
59
    public function toArray($notifiable)
0 ignored issues
show
The parameter $notifiable is not used and could be removed. ( Ignorable by Annotation )

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

59
    public function toArray(/** @scrutinizer ignore-unused */ $notifiable)

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

Loading history...
60
    {
61
        return [
62
            //
63
        ];
64
    }
65
}
66