for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Adminetic\Announcement\Notifications;
use Illuminate\Bus\Queueable;
use League\HTMLToMarkdown\HtmlConverter;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\SlackMessage;
use Adminetic\Announcement\Models\Admin\Announcement;
class SlackAnnouncementNotification extends Notification
{
use Queueable;
protected $announcement;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(Announcement $announcement)
$this->announcement = $announcement;
}
* 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 ['slack'];
* Get the Slack representation of the notification.
* @return \Illuminate\Notifications\Messages\SlackMessage
public function toSlack($notifiable)
public function toSlack(/** @scrutinizer ignore-unused */ $notifiable)
return (new SlackMessage)
->from(setting('title', config('adminetic.title', 'Adminetic')) . ' - ' . $this->announcement->user->name ?? 'N/A')
setting
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
->from(/** @scrutinizer ignore-call */ setting('title', config('adminetic.title', 'Adminetic')) . ' - ' . $this->announcement->user->name ?? 'N/A')
->image(getLogo())
getLogo
->image(/** @scrutinizer ignore-call */ getLogo())
->content((new HtmlConverter())->convert($this->announcement->body));
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.