Always prefer ::class notation

This commit is contained in:
Lucas Michot
2024-10-28 14:56:13 +01:00
parent 94e73c6d8b
commit c5403b0b3f
31 changed files with 99 additions and 99 deletions

View File

@@ -52,7 +52,7 @@ class DeploymentSuccess extends Notification implements ShouldQueue
$channels = setNotificationChannels($notifiable, 'deployments');
if (isCloud()) {
// TODO: Make batch notifications work with email
$channels = array_diff($channels, ['App\Notifications\Channels\EmailChannel']);
$channels = array_diff($channels, [\App\Notifications\Channels\EmailChannel::class]);
}
return $channels;

View File

@@ -18,23 +18,23 @@ class TelegramChannel
$topicsInstance = get_class($notification);
switch ($topicsInstance) {
case 'App\Notifications\Test':
case \App\Notifications\Test::class:
$topicId = data_get($notifiable, 'telegram_notifications_test_message_thread_id');
break;
case 'App\Notifications\Application\StatusChanged':
case 'App\Notifications\Container\ContainerRestarted':
case 'App\Notifications\Container\ContainerStopped':
case \App\Notifications\Application\StatusChanged::class:
case \App\Notifications\Container\ContainerRestarted::class:
case \App\Notifications\Container\ContainerStopped::class:
$topicId = data_get($notifiable, 'telegram_notifications_status_changes_message_thread_id');
break;
case 'App\Notifications\Application\DeploymentSuccess':
case 'App\Notifications\Application\DeploymentFailed':
case \App\Notifications\Application\DeploymentSuccess::class:
case \App\Notifications\Application\DeploymentFailed::class:
$topicId = data_get($notifiable, 'telegram_notifications_deployments_message_thread_id');
break;
case 'App\Notifications\Database\BackupSuccess':
case 'App\Notifications\Database\BackupFailed':
case \App\Notifications\Database\BackupSuccess::class:
case \App\Notifications\Database\BackupFailed::class:
$topicId = data_get($notifiable, 'telegram_notifications_database_backups_message_thread_id');
break;
case 'App\Notifications\ScheduledTask\TaskFailed':
case \App\Notifications\ScheduledTask\TaskFailed::class:
$topicId = data_get($notifiable, 'telegram_notifications_scheduled_tasks_thread_id');
break;
}

View File

@@ -25,7 +25,7 @@ class Test extends Notification implements ShouldQueue
public function middleware(object $notifiable, string $channel)
{
return match ($channel) {
'App\Notifications\Channels\EmailChannel' => [new RateLimited('email')],
\App\Notifications\Channels\EmailChannel::class => [new RateLimited('email')],
default => [],
};
}