Version::normalize()

static string|null normalize(string $version, int|null $precision)

Normalizes a version string to the number of components given in the parameter $precision.

Examples:

Version::normalize('1.2.3', 1);
// => '1'

Version::normalize('1.2.3', 2);
// => '1.2'

Parameters

string $version A version string
int|null $precision The number of components to include. Pass NULL to return the version unchanged.

Return Value

string|null The normalized version or NULL if it couldn't be normalized.
doc_Symfony
2016-10-28 06:37:04
Comments
Leave a Comment

Please login to continue.