for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace FormEntries\Notifications;
use FormEntries\Forms\FormContent;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class FormEntryReceived extends Notification implements ShouldQueue
{
use Queueable;
public FormContent $content;
public ?string $subject = null;
public function __construct(FormContent $content)
$this->content = $content;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable = null)
$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 = null)
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 MailMessage
public function toMail($notifiable)
public function toMail(/** @scrutinizer ignore-unused */ $notifiable)
/** @var MailMessage $message */
$message = (new MailMessage)
->subject($this->getSubject())
->greeting(trans('forms-entries::notification.form_content_greeting'))
->line(trans('forms-entries::notification.form_content_header'));
foreach (explode("\n", $this->content->stringify()) as $line) {
$message->line($line);
return $message;
protected function getSubject(): string
if ($this->subject) {
return $this->subject;
return trans('forms-entries::notification.form_subject', ['name' => $this->content->formName()]);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.