for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Notifications;
use App\Models\Event;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class ExpiringEventMailNotification extends Notification
{
use Queueable;
protected array $senderData;
protected Event $event;
/**
* Create a new notification instance.
*
* @param array $senderData
* @param \App\Models\Event $event
*/
public function __construct(array $senderData, Event $event)
$this->senderData = $senderData;
$this->event = $event;
}
* Get the notification's delivery channels.
* @param mixed $notifiable
* @return array
public function via($notifiable)
$notifiable
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
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.
return ['mail'];
* Get the mail representation of the notification.
* @return \Illuminate\Notifications\Messages\MailMessage
public function toMail($notifiable): MailMessage
public function toMail(/** @scrutinizer ignore-unused */ $notifiable): MailMessage
return (new MailMessage())
->subject('Expiring Event - CI Global Calendar')
->markdown('mail.expiringEvent', [
'event' => $this->event,
'senderData' => $this->senderData
]);
* Get the array representation of the notification.
public function toArray($notifiable)
public function toArray(/** @scrutinizer ignore-unused */ $notifiable)
return [
//
];
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.