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

BackupDestinationFactory::createFromArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 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