• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SameOldNick / SameOldWebsite / 20218987083

15 Dec 2025 02:57AM UTC coverage: 87.51% (-0.2%) from 87.681%
20218987083

push

github

SameOldNick
Set default value for topic in fromArray method

The fromArray method now assigns an empty string as the default value for 'topic' if it is not present in the input array. This prevents potential undefined index errors.

1 of 1 new or added line in 1 file covered. (100.0%)

117 existing lines in 10 files now uncovered.

28509 of 32578 relevant lines covered (87.51%)

696.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/Components/Backup/Concerns/ApplyNotificationConfiguration.php
1
<?php
2

3
namespace App\Components\Backup\Concerns;
4

5
use App\Components\Backup\Contracts\NotificationConfigurationProviderInterface;
6
use Illuminate\Notifications\Messages\MailMessage;
7
use Illuminate\Notifications\Messages\SlackMessage;
8
use Ntfy\Message as NtfyMessage;
9
use Spatie\Backup\Notifications\Channels\Discord\DiscordMessage;
10

11
trait ApplyNotificationConfiguration
12
{
13
    /**
14
     * Gets the configuration provider.
15
     */
16
    protected function getConfigurationProvider(): NotificationConfigurationProviderInterface
17
    {
UNCOV
18
        return app(NotificationConfigurationProviderInterface::class);
×
19
    }
20

21
    /**
22
     * Applies configuration to mail message.
23
     */
24
    protected function applyConfigurationToMailMessage(MailMessage $mailMessage): MailMessage
25
    {
UNCOV
26
        $configurationProvider = $this->getConfigurationProvider();
×
27

UNCOV
28
        return $mailMessage->from($configurationProvider->getMailFromEmail(), $configurationProvider->getMailFromName());
×
29
    }
30

31
    /**
32
     * Applies configuration to slack message.
33
     */
34
    protected function applyConfigurationToSlackMessage(SlackMessage $slackMessage): SlackMessage
35
    {
UNCOV
36
        $configurationProvider = $this->getConfigurationProvider();
×
37

38
        return $slackMessage
×
39
            ->from($configurationProvider->getSlackUsername(), $configurationProvider->getSlackIcon())
×
UNCOV
40
            ->to($configurationProvider->getSlackChannel());
×
41
    }
42

43
    /**
44
     * Applies configuration to discord message.
45
     */
46
    protected function applyConfigurationToDiscordMessage(DiscordMessage $discordMessage): DiscordMessage
47
    {
UNCOV
48
        $configurationProvider = $this->getConfigurationProvider();
×
49

UNCOV
50
        return $discordMessage->from($configurationProvider->getDiscordUsername(), $configurationProvider->getDiscordAvatarUrl());
×
51
    }
52

53
    /**
54
     * Applies configuration to ntfy message.
55
     */
56
    protected function applyConfigurationToNtfyMessage(NtfyMessage $ntfyMessage): NtfyMessage
57
    {
UNCOV
58
        $configurationProvider = $this->getConfigurationProvider();
×
59

UNCOV
60
        if ($topic = $configurationProvider->getNtfyTopic()) {
×
UNCOV
61
            $ntfyMessage->topic($topic);
×
62
        }
63

UNCOV
64
        return $ntfyMessage;
×
65
    }
66
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc