Passed
Push — master ( 1438ee...6641ad )
by Quentin
06:42 queued 12s
created

Glide   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A makeCloudSource() 0 17 5
1
<?php
2
3
namespace A17\Twill\Services\Cloud;
4
5
use Exception;
6
7
class Glide
8
{
9
    function makeCloudSource($source = null)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
10
    {
11
        if (blank($source)) {
12
            throw new Exception(
13
                'Glide source was not set, please set your GLIDE_SOURCE environment variable or pass the source.'
14
            );
15
        }
16
17
        if ($source == 's3' || $source == 'aws') {
18
            return app(Aws::class)->filesystemFactory($source);
19
        }
20
21
        if ($source == 'azure') {
22
            return app(Azure::class)->filesystemFactory($source);
23
        }
24
25
        return $source;
26
    }
27
}
28