Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO_REFERENCE_TEXT in Version::NO_REFERENCE_TEXT #38

Merged
merged 3 commits into from Feb 22, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Version.php
Expand Up @@ -20,12 +20,14 @@ class Version
/** @var bool */
private $versionIsTagged;

const NO_REFERENCE_TEXT = '{no reference}';
DeyV marked this conversation as resolved.
Show resolved Hide resolved

public function __construct(string $packageName, string $prettyVersion, ?string $reference = null)
{
$this->packageName = $packageName;
$this->prettyVersion = $prettyVersion;
$this->reference = $reference ?? '{no reference}';
$this->versionIsTagged = preg_match('/[^v\d\.]/', $this->getShortVersion()) === 0;
$this->reference = $reference ?? self::NO_REFERENCE_TEXT;
$this->versionIsTagged = preg_match('/[^v\d.]/', $this->getShortVersion()) === 0;
}

public function getPrettyVersion(): string
Expand Down