Skip to content

Commit

Permalink
Fix: Add links
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Dec 26, 2023
1 parent 2023b08 commit 93bb311
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,19 @@ public static function fromString(string $value): self

public function toString(): string
{
/**
* @see https://semver.org/#spec-item-2
*/
$value = \sprintf(
'%s.%s.%s',
$this->major->toString(),
$this->minor->toString(),
$this->patch->toString(),
);

/**
* @see https://semver.org/#spec-item-9
*/
if (!$this->preRelease->equals(PreRelease::empty())) {
$value = \sprintf(
'%s-%s',
Expand All @@ -83,6 +89,9 @@ public function toString(): string
);
}

/**
* @see https://semver.org/#spec-item-10
*/
if (!$this->buildMetaData->equals(BuildMetaData::empty())) {
$value = \sprintf(
'%s+%s',
Expand All @@ -94,6 +103,9 @@ public function toString(): string
return $value;
}

/**
* @see https://semver.org/#spec-item-8
*/
public function bumpMajor(): self
{
return new self(
Expand All @@ -105,6 +117,9 @@ public function bumpMajor(): self
);
}

/**
* @see https://semver.org/#spec-item-7
*/
public function bumpMinor(): self
{
return new self(
Expand All @@ -116,6 +131,9 @@ public function bumpMinor(): self
);
}

/**
* @see https://semver.org/#spec-item-6
*/
public function bumpPatch(): self
{
return new self(
Expand Down

0 comments on commit 93bb311

Please sign in to comment.