<commit_before><?php

namespace Spatie\Backup\Notifications;

use Spatie\Backup\Helpers\Format;
use Illuminate\Support\Collection;
use Illuminate\Notifications\Notification;

abstract class BaseNotification extends Notification
{
    /**
     * Get the notification's delivery channels.
     *
     * @return array
     */
    public function via()
    {
        return config('laravel-backup.notifications.notifications.'.static::class);
    }

    public function applicationName(): string
    {
        return config('app.name') ?? config('app.url') ?? 'Laravel application';
    }

    public function backupName(): string
    {
        return $this->backupDestination()->backupName();
    }

    public function diskName(): string
    {
        return $this->backupDestination()->diskName();
    }<commit_msg>Check for empty string in BaseNotification via() (#395)<commit_after><?php

namespace Spatie\Backup\Notifications;

use Spatie\Backup\Helpers\Format;
use Illuminate\Support\Collection;
use Illuminate\Notifications\Notification;

abstract class BaseNotification extends Notification
{
    /**
     * Get the notification's delivery channels.
     *
     * @return array
     */
    public function via()
    {
        $notificationChannels = config('laravel-backup.notifications.notifications.'.static::class);

        if (empty($notificationChannels) || empty($notificationChannels[0])) {
            return [];
        }

        return $notificationChannels;
    }

    public function applicationName(): string
    {
        return config('app.name') ?? config('app.url') ?? 'Laravel application';
    }

    public function backupName(): string
    {
        return $this->backupDestination()->backupName();
    }

    public function diskName(): string
    {
        return $this->backupDestination()->diskName();
    }
{'fraction_non_alphanumeric': 0.12071778140293637, 'fraction_numerical': 0.002175095160413268, 'mean_word_length': 3.116331096196868, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5310269', 'n_tokens_mistral': 478, 'n_tokens_neox': 478, 'n_words': 107}