| Conditions | 8 |
| Paths | 8 |
| Total Lines | 25 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 8 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | 2 | public static function getProtocol(string $schema, RemoteRequest\Interfaces\IRRTranslations $lang): AProtocol |
|
| 23 | { |
||
| 24 | switch ($schema) { |
||
| 25 | 2 | case 'tcp': |
|
| 26 | 2 | case 'file': |
|
| 27 | 1 | return new Tcp(); |
|
| 28 | 2 | case 'udp': |
|
| 29 | 1 | return new Udp(); |
|
| 30 | 2 | case 'fsp': |
|
| 31 | 1 | return new Fsp(); |
|
| 32 | 2 | case 'http': |
|
| 33 | 2 | case 'https': |
|
| 34 | 1 | return new Http(); |
|
| 35 | // case 'http2': |
||
| 36 | // return new Http2(); |
||
| 37 | // case 'http3': |
||
| 38 | // return new Http3(); |
||
| 39 | 2 | case 'webdav': |
|
| 40 | 1 | return new WebDAV(); |
|
| 41 | // case 'smb': |
||
| 42 | // return new Samba(); |
||
| 43 | // case 'git': |
||
| 44 | // return new Git(); |
||
| 45 | default: |
||
| 46 | 1 | throw new RemoteRequest\RequestException($lang->rrSchemaUnknownResponse($schema)); |
|
| 47 | } |
||
| 50 |