| Conditions | 8 |
| Paths | 8 |
| Total Lines | 23 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 8 |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | 8 | public function getFactoryClassName(string $type) |
|
| 11 | { |
||
| 12 | 8 | if (class_exists($type)) { |
|
| 13 | 1 | return $type; |
|
| 14 | } |
||
| 15 | |||
| 16 | switch ($type) { |
||
| 17 | 7 | case 'dropbox': |
|
| 18 | 1 | return DropBoxAdapterFactory::class; |
|
| 19 | 6 | case 's3': |
|
| 20 | 1 | return S3AdapterFactory::class; |
|
| 21 | 5 | case 'azure': |
|
| 22 | 1 | return AzureAdapterFactory::class; |
|
| 23 | 4 | case 'ftp': |
|
| 24 | 1 | return FtpAdaptorFactory::class; |
|
| 25 | 3 | case 'local': |
|
| 26 | 1 | return LocalAdaptorFactory::class; |
|
| 27 | 2 | case 'null': |
|
| 28 | 1 | return NullAdaptorFactory::class; |
|
| 29 | } |
||
| 30 | |||
| 31 | 1 | return null; |
|
| 32 | } |
||
| 33 | } |
||
| 34 |