* returns a x.y.z form of the provided version. Extra numbers will be * omitted, missing ones added as zeros. */
(string $version)
| 54 | * omitted, missing ones added as zeros. |
| 55 | */ |
| 56 | public function normalizeVersion(string $version): string |
| 57 | { |
| 58 | $versionNumbers = array_slice(explode('.', $version), 0, 3); |
| 59 | $versionNumbers[0] = $versionNumbers[0] ?: '0'; // deal with empty input |
| 60 | while (count($versionNumbers) < 3) { |
| 61 | // changelog server expects x.y.z, pad 0 if it is too short |
| 62 | $versionNumbers[] = 0; |
| 63 | } |
| 64 | return implode('.', $versionNumbers); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * @param string $uri |
no outgoing calls
no test coverage detected