Conditions | 5 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | function makeCloudSource($source = null) |
||
|
|||
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 | } |
||
28 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.