1 | <?php |
||||
2 | |||||
3 | namespace jeremykenedy\laravel2step\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 | |||||
10 | class SendVerificationCodeEmail extends Notification implements ShouldQueue |
||||
11 | { |
||||
12 | use Queueable; |
||||
13 | |||||
14 | protected $code; |
||||
15 | protected $user; |
||||
16 | |||||
17 | /** |
||||
18 | * Create a new notification instance. |
||||
19 | */ |
||||
20 | public function __construct($user, $code) |
||||
21 | { |
||||
22 | $this->code = $code; |
||||
23 | $this->user = $user; |
||||
24 | } |
||||
25 | |||||
26 | /** |
||||
27 | * Get the notification's delivery channels. |
||||
28 | * |
||||
29 | * @param mixed $notifiable |
||||
30 | * |
||||
31 | * @return array |
||||
32 | */ |
||||
33 | public function via($notifiable) |
||||
0 ignored issues
–
show
|
|||||
34 | { |
||||
35 | return ['mail']; |
||||
36 | } |
||||
37 | |||||
38 | /** |
||||
39 | * Get the mail representation of the notification. |
||||
40 | * |
||||
41 | * @param mixed $notifiable |
||||
42 | * |
||||
43 | * @return \Illuminate\Notifications\Messages\MailMessage |
||||
44 | */ |
||||
45 | 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
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||
46 | { |
||||
47 | $message = new MailMessage(); |
||||
48 | $message |
||||
49 | ->from(config('laravel2step.verificationEmailFrom'), config('laravel2step.verificationEmailFromName')) |
||||
50 | ->subject(trans('laravel2step::laravel-verification.verificationEmailSubject')) |
||||
0 ignored issues
–
show
It seems like
trans('laravel2step::lar...ificationEmailSubject') can also be of type array and array ; however, parameter $subject of Illuminate\Notifications...impleMessage::subject() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
51 | ->greeting(trans('laravel2step::laravel-verification.verificationEmailGreeting', ['username' => $this->user->name])) |
||||
0 ignored issues
–
show
It seems like
trans('laravel2step::lar... => $this->user->name)) can also be of type array and array ; however, parameter $greeting of Illuminate\Notifications...mpleMessage::greeting() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
52 | ->line(trans('laravel2step::laravel-verification.verificationEmailMessage')) |
||||
53 | ->line($this->code) |
||||
54 | ->action(trans('laravel2step::laravel-verification.verificationEmailButton'), route('laravel2step::verificationNeeded')); |
||||
0 ignored issues
–
show
It seems like
trans('laravel2step::lar...rificationEmailButton') can also be of type array and array ; however, parameter $text of Illuminate\Notifications...SimpleMessage::action() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
55 | |||||
56 | return $message; |
||||
57 | } |
||||
58 | } |
||||
59 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.