GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( b6e664...ecdbf9 )
by Cees-Jan
03:06
created

ApiSettings   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 21
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getVersion() 0 14 3
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Pusher;
4
5
use PackageVersions\Versions;
6
7
final class ApiSettings
8
{
9
    /**
10
     * @param string $version
11
     * @return string
12
     */
13 3
    public static function getVersion(string $version = ''): string
14
    {
15 3
        if ($version === '') {
16 1
            $version = Versions::getVersion('api-clients/pusher');
17
        }
18
19 3
        list($version, $hash) = explode('@', $version);
20
21 3
        if (substr($version, -4) === '-dev') {
22 1
            return '0.0.1-' . $hash;
23
        }
24
25 2
        return $version;
26
    }
27
}
28