Completed
Push — master ( f62f21...f72c97 )
by Freek
05:09
created

BackupDestinationFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
c 2
b 0
f 1
lcom 0
cbo 2
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createFromArray() 0 7 1
1
<?php
2
3
namespace Spatie\Backup\BackupDestination;
4
5
class BackupDestinationFactory
6
{
7
    /**
8
     * @param array $config
9
     *
10
     * @return \Illuminate\Support\Collection
11
     */
12
    public static function createFromArray(array $config)
13
    {
14
        return collect($config['destination']['filesystems'])
15
            ->map(function ($filesystemName) use ($config) {
16
                return BackupDestination::create($filesystemName, $config['name']);
17
            });
18
    }
19
}
20