Version   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 20
ccs 2
cts 4
cp 0.5
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getVersion() 0 4 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