Completed
Push — master ( 79e89c...34165e )
by Nikola
01:13
created

InvalidVersionString::getVersionString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Version\Exception;
6
7
use DomainException;
8
9
class InvalidVersionString extends DomainException implements VersionException
10
{
11
    /** @var string */
12
    protected $versionString;
13
14 5
    public static function notParsable(string $versionString): self
15
    {
16 5
        $exception = new self(sprintf("Version string '%s' is not valid and cannot be parsed", $versionString));
17 5
        $exception->versionString = $versionString;
18
19 5
        return $exception;
20
    }
21
22 3
    public function getVersionString(): string
23
    {
24 3
        return $this->versionString;
25
    }
26
}
27