Passed
Push — master ( c11447...ba145f )
by mon
02:14
created

Version::get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 6
rs 10
c 1
b 0
f 1
ccs 3
cts 4
cp 0.75
crap 2.0625
1
<?php declare(strict_types=1);
2
3
namespace FileEye\MimeMap;
4
5
use Composer\InstalledVersions;
6
7
/**
8
 * MimeMap version.
9
 */
10
class Version
11
{
12
    /**
13
     * Returns the current version of MimeMap.
14
     */
15 1
    public static function get(): string
16
    {
17 1
        if ($version = InstalledVersions::getPrettyVersion('fileeye/mimemap')) {
18 1
            return $version;
19
        }
20
        throw new \RuntimeException("MimeMap could not determine its own version from Composer");
21
    }
22
}
23