Version::getVersion()   A
last analyzed

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 ProxyManager;
6
7
use OutOfBoundsException;
8
use PackageVersions\Versions;
9
10
/**
11
 * Version class
12
 *
13
 * Note that we cannot check the version at runtime via `git` because that would cause a lot of I/O operations.
14
 */
15
final class Version
16
{
17
    /**
18
     * Private constructor - this class is not meant to be instantiated
19
     */
20
    private function __construct()
21
    {
22
    }
23
24
    /**
25
     * Retrieves the package version in the format <detected-version>@<commit-hash>,
26
     * where the detected version is what composer could detect.
27
     *
28
     * @throws OutOfBoundsException
29
     */
30
    public static function getVersion() : string
31 1
    {
32
        return Versions::getVersion('ocramius/proxy-manager');
33 1
    }
34
}
35