# SemverUtil

> Normalizes asset-manager semantic versions for Composer.

[API reference](/docs/api/index.md) › [Foxy](/docs/extensions/foxy/reference/index.md) › [Converter](/docs/extensions/foxy/reference/converter/index.md) › SemverUtil

| abstract class | `Foxy\Converter\SemverUtil` |
| --- | --- |
| Source | [`src/Converter/SemverUtil.php`](https://github.com/php-forge/foxy/blob/main/src/Converter/SemverUtil.php#L23) |

Normalizes asset-manager semantic versions for Composer.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`convertDateVersion()`](#method-convertDateVersion) static | Converts the date or datetime version. | `SemverUtil` |
| [`convertVersionMetadata()`](#method-convertVersionMetadata) static | Converts prerelease and build metadata to Composer's normalized stability notation. | `SemverUtil` |
| [`createPattern()`](#method-createPattern) static | Creates a pattern with the version prefix pattern. | `SemverUtil` |

## Method details

### convertDateVersion() <span id="method-convertDateVersion"></span>

```php
public static function convertDateVersion(string $version): string
```

Converts the date or datetime version.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$version` | `string` | The version. |

**Returns**

`string`

### convertVersionMetadata() <span id="method-convertVersionMetadata"></span>

```php
public static function convertVersionMetadata(string $version): string
```

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

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$version` | `string` |  |

**Returns**

`string`

### createPattern() <span id="method-createPattern"></span>

```php
public static function createPattern(string $pattern): string
```

Creates a pattern with the version prefix pattern.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$pattern` | `string` | The pattern without '/'. |

**Returns**

`string`: The full pattern with '/'.