Completed
Push — master ( ba16c1...577bec )
by ARCANEDEV
13s
created

Backups::statuses()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php namespace Arcanesoft\Foundation\Services;
2
3
use Spatie\Backup\Tasks\Monitor\BackupDestinationStatusFactory;
4
5
/**
6
 * Class     Backups
7
 *
8
 * @package  Arcanesoft\Foundation\Services
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class Backups
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Main Functions
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * Get all the statuses.
19
     *
20
     * @return \Illuminate\Support\Collection
21
     */
22
    public static function statuses()
23
    {
24
        return BackupDestinationStatusFactory::createForMonitorConfig(config('laravel-backup.monitorBackups'));
25
    }
26
27
    /**
28
     * Get a status by index.
29
     *
30
     * @param  int  $index
31
     *
32
     * @return \Spatie\Backup\Tasks\Monitor\BackupDestinationStatus|null
33
     */
34
    public static function getStatus($index)
35
    {
36
        return static::statuses()->get($index);
37
    }
38
}
39