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