Skip to content
PHP Ecosystem
Explore

SemverUtil

API reference › Foxy › Converter › SemverUtil

abstract classFoxy\Converter\SemverUtil
Sourcesrc/Converter/SemverUtil.php

Normalizes asset-manager semantic versions for Composer.

MethodDescriptionDefined by
convertDateVersion() staticConverts the date or datetime version.SemverUtil
convertVersionMetadata() staticConverts prerelease and build metadata to Composer’s normalized stability notation.SemverUtil
createPattern() staticCreates a pattern with the version prefix pattern.SemverUtil
public static function convertDateVersion(string $version): string

Converts the date or datetime version.

Parameters

ParameterTypeDescription
$versionstringThe version.

Returns

string

public static function convertVersionMetadata(string $version): string

Converts prerelease and build metadata to Composer’s normalized stability notation.

Parameters

ParameterTypeDescription
$versionstring

Returns

string

public static function createPattern(string $pattern): string

Creates a pattern with the version prefix pattern.

Parameters

ParameterTypeDescription
$patternstringThe pattern without ’/’.

Returns

string: The full pattern with ’/’.