class SemVer implements TaskInterface (View source)

Helps to maintain .semver file.

<?php
$this->taskSemVer('.semver')
     ->increment()
     ->run();
?>

Constants

SEMVER

REGEX

REGEX_STRING

Properties

protected string $format
protected string $specialSeparator
protected string $metadataSeparator
protected string $path
protected array $version

Methods

__construct(string $filename = '')

No description

string
__toString()

No description

$this
version(string $version)

No description

$this
setFormat(string $format)

No description

$this
setMetadataSeparator(string $separator)

No description

$this
setPrereleaseSeparator(string $separator)

No description

$this
increment(string $what = 'patch')

No description

$this
prerelease(string $tag = 'RC')

No description

$this
metadata(array|string $data)

No description

run()

No description

bool
dump()

No description

parseString(string $semverString)

No description

parseFile(string $semverFileContents)

No description

Details

__construct(string $filename = '')

No description

Parameters

string $filename

string __toString()

No description

Return Value

string

$this version(string $version)

No description

Parameters

string $version

Return Value

$this

$this setFormat(string $format)

No description

Parameters

string $format

Return Value

$this

$this setMetadataSeparator(string $separator)

No description

Parameters

string $separator

Return Value

$this

$this setPrereleaseSeparator(string $separator)

No description

Parameters

string $separator

Return Value

$this

$this increment(string $what = 'patch')

No description

Parameters

string $what

Return Value

$this

Exceptions

TaskException

$this prerelease(string $tag = 'RC')

No description

Parameters

string $tag

Return Value

$this

Exceptions

TaskException

$this metadata(array|string $data)

No description

Parameters

array|string $data

Return Value

$this

Result run()

No description

Return Value

Result

protected bool dump()

No description

Return Value

bool

Exceptions

TaskException

protected parseString(string $semverString)

No description

Parameters

string $semverString

Exceptions

TaskException

protected parseFile(string $semverFileContents)

No description

Parameters

string $semverFileContents

Exceptions

TaskException