• 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/Notifications/UnhealthyBackupWasFoundNotification.php
1
<?php
2

3
namespace App\Components\Backup\Notifications;
4

5
use App\Components\Backup\Concerns\PullsNotificationConfiguration;
6
use App\Components\Ntfy\Services\MessageBuilder;
7
use Ntfy\Message as NtfyMessage;
8
use Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFoundNotification as BaseNotification;
9

10
class UnhealthyBackupWasFoundNotification extends BaseNotification
11
{
12
    use PullsNotificationConfiguration;
13

14
    /**
15
     * Create an ntfy message representation of the notification.
16
     */
17
    public function toNtfy($notifiable): NtfyMessage
18
    {
UNCOV
19
        $message = [
×
UNCOV
20
            __('An unhealthy backup was detected during the backup process.'),
×
21

UNCOV
22
            __('Failure details:'),
×
UNCOV
23
            json_encode([
×
UNCOV
24
                'name' => $this->failure()->healthCheck()->name(),
×
UNCOV
25
                'unexpected' => $this->failure()->wasUnexpected(),
×
UNCOV
26
            ], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES),
×
27

UNCOV
28
            __('Exception details:'),
×
UNCOV
29
            json_encode([
×
UNCOV
30
                'message' => $this->failure()->exception()->getMessage(),
×
UNCOV
31
                'type' => get_class($this->failure()->exception()),
×
UNCOV
32
                'trace' => $this->failure()->exception()->getTrace(),
×
UNCOV
33
            ], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES),
×
34

UNCOV
35
            __('Backup Destination Properties:'),
×
UNCOV
36
            json_encode($this->backupDestinationProperties()->toArray(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES),
×
UNCOV
37
        ];
×
38

UNCOV
39
        return MessageBuilder::make()
×
UNCOV
40
            ->title(__('Unhealthy Backup Was Found'))
×
UNCOV
41
            ->body(implode("\n", $message))
×
UNCOV
42
            ->build();
×
43
    }
44
}
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