MCPcopy Create free account
hub / github.com/Rello/analytics / normalizeVersion

Method normalizeVersion

lib/WhatsNew/WhatsNewCheck.php:56–65  ·  view source on GitHub ↗

* returns a x.y.z form of the provided version. Extra numbers will be * omitted, missing ones added as zeros. */

(string $version)

Source from the content-addressed store, hash-verified

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

Callers 4

getChangesForVersionMethod · 0.95
checkMethod · 0.95
getMethod · 0.80
dismissMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected