meeting the requirements of a static analyzer

This commit is contained in:
Anatoliy Poloz
2024-01-15 17:11:55 +03:00
81 changed files with 1320 additions and 501 deletions

View File

@@ -2,7 +2,6 @@
namespace App\Notifications;
use App\Models\ChosenDiet;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
@@ -12,37 +11,23 @@ class DietStarted extends Notification implements ShouldQueue
{
use Queueable;
public ChosenDiet $chosenDiet;
public object $chosenDiet;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(ChosenDiet $chosenDiet)
public function __construct(object $chosenDiet)
{
$this->afterCommit();
$this->chosenDiet = $chosenDiet;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
public function via(object $notifiable): array
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage())
->line('you are successful started diet named: '.($this->chosenDiet->diet->name ?? 'NoName'))
@@ -50,13 +35,7 @@ class DietStarted extends Notification implements ShouldQueue
->line('Thank you for using our application!');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
public function toArray(object $notifiable): array
{
return [