| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 11 | public static function buildEndpoint(...$endpoints): string |
|
| 18 | { |
||
| 19 | 11 | $url = ''; |
|
| 20 | |||
| 21 | 11 | foreach ($endpoints as $endpoint) { |
|
| 22 | 11 | if (is_string($endpoint)) { |
|
| 23 | 11 | $url = implode('/', array_filter([$url, $endpoint])); |
|
| 24 | 11 | continue; |
|
| 25 | } |
||
| 26 | |||
| 27 | 10 | if (is_array($endpoint)) { |
|
| 28 | 10 | $url .= '/'.implode('/', $endpoint); |
|
| 29 | 10 | continue; |
|
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | 11 | return $url; |
|
| 34 | } |
||
| 36 |