for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PeriodicNotice\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
use Illuminate\Support\Collection;
class PeriodicPublicationNotification extends Notification implements ShouldQueue
{
use Queueable;
use HasDynamicChannels {
HasDynamicChannels::via as dynamicVia;
}
public function __construct(
protected Collection $entities
) {
public function via($notifiable)
if ($this->entities->count() > 0) {
return $this->dynamicVia($notifiable);
return [];
protected function mailMessageBuilder($notifiable): MailMessageBuilder
$notifiable
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
protected function mailMessageBuilder(/** @scrutinizer ignore-unused */ $notifiable): MailMessageBuilder
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$className = config('periodic-notice.defaults.mail_builder', MailMessageBuilder::class);
if (!is_a($className, MailMessageBuilder::class, true)) {
throw new \Exception('Wrong mail builder class');
return $className::make();
public function toMail($notifiable)
return $this->mailMessageBuilder($notifiable)
->useEntries($this->entities)
->build();
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.