ResetAdminPassword::via()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
11
class ResetAdminPassword extends Notification implements ShouldQueue
12
{
13
    use Queueable;
14
    use SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by Thinktomorrow\Chief\App\...ions\ResetAdminPassword: $collectionClass, $relations, $class, $keyBy
Loading history...
15
16
    public $token;
17
18
    public function __construct($token)
19
    {
20
        $this->token = $token;
21
    }
22
23
    /**
24
     * Get the notification's delivery channels.
25
     *
26
     * @param  mixed  $notifiable
27
     * @return array
28
     */
29
    public function via($notifiable)
0 ignored issues
show
Unused Code introduced by
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)

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
Unused Code introduced by
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('Herstel jouw wachtwoord.')
44
            ->from(chiefSetting('from_email', null, chiefSetting('contact_email')), chiefSetting('from_name', null, chiefSetting('contact_name')))
45
            ->view('chief::mails.password-reset', [
46
                'reset_url' => route('chief.back.password.reset', $this->token),
47
            ]);
48
    }
49
50
    /**
51
     * Get the array representation of the notification.
52
     *
53
     * @param  mixed  $notifiable
54
     * @return array
55
     */
56
    public function toArray($notifiable)
0 ignored issues
show
Unused Code introduced by
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

56
    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...
57
    {
58
        return [
59
            //
60
        ];
61
    }
62
}
63