for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Xetaravel\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
use Xetaravel\Models\ShopItem;
class ShopItemNotification extends Notification implements ShouldQueue
{
use Queueable;
/**
* The item instance.
*
* @var ShopItem
*/
public ShopItem $item;
* Create a new notification instance.
* @param ShopItem $item
public function __construct(ShopItem $item)
$this->item = $item;
}
* Get the notification's delivery channels.
* @param mixed $notifiable
* @return array
public function via($notifiable): array
$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): array
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return ['database'];
* Get the array representation of the notification.
public function toDatabase($notifiable): array
public function toDatabase(/** @scrutinizer ignore-unused */ $notifiable): array
return [
'message' => 'You have bought the Xeticon <strong>%s</strong> !',
'message_key' => [$this->item->title],
'icon' => $this->item->item_icon,
'type' => 'shop_item'
];
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.