Skip to content

Commit

Permalink
NO_REFERENCE_TEXT in Version::NO_REFERENCE_TEXT (#38)
Browse files Browse the repository at this point in the history
* NO_REFERENCE_TEXT in  Version::NO_REFERENCE_TEXT

* redundant character escape

* We now require 7.1, so we can make the visibility explicit

Co-authored-by: Dawid 'DeyV' Polak <[email protected]>
  • Loading branch information
DeyV and Dawid 'DeyV' Polak authored Feb 22, 2021
1 parent dd90853 commit 15ee839
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ class Version
/** @var bool */
private $versionIsTagged;

public const NO_REFERENCE_TEXT = '{no reference}';

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

0 comments on commit 15ee839

Please sign in to comment.