| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public static function parseRepositoryName(string $repositoryUrl): string |
||
| 14 | { |
||
| 15 | $scheme = parse_url($repositoryUrl, PHP_URL_SCHEME); |
||
| 16 | |||
| 17 | if ($scheme === null) { |
||
| 18 | $parts = explode('/', $repositoryUrl); |
||
| 19 | $path = end($parts); |
||
| 20 | } else { |
||
| 21 | $strpos = strpos($repositoryUrl, ':'); |
||
| 22 | $path = substr($repositoryUrl, $strpos + 1); |
||
| 23 | } |
||
| 24 | |||
| 25 | /** @var string $path */ |
||
| 26 | return basename($path, '.git'); |
||
| 27 | } |
||
| 28 | } |
||
| 29 |