Completed
Pull Request — master (#91)
by Markus
02:03
created

Versions::getVersion()   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 1
crap 1
1
<?php
2
3
namespace PackageVersions;
4
5
/**
6
 * This is a stub class: it is in place only for scenarios where PackageVersions
7
 * is installed with a `--no-scripts` flag, in which scenarios the Versions class
8
 * is not being replaced.
9
 *
10
 * If you are reading this docBlock inside your `vendor/` dir, then this means
11
 * that PackageVersions didn't correctly install, and is in "fallback" mode.
12
 */
13
final class Versions
14
{
15
    const ROOT_PACKAGE_NAME = FallbackVersions::ROOT_PACKAGE_NAME;
16
    const VERSIONS = [];
17
18
    private function __construct()
19
    {
20
    }
21
22
    /**
23
     * @throws \OutOfBoundsException if a version cannot be located
24
     * @throws \UnexpectedValueException if the composer.lock file could not be located
25
     */
26 2
    public static function getVersion(string $packageName) : string
27
    {
28 2
        return FallbackVersions::getVersion($packageName);
29
    }
30
}
31