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.
Passed
Push — master ( fba8ee...5e9ebc )
by Anton
02:06
created

Dumper   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 43
ccs 0
cts 25
cp 0
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toComponents() 0 10 1
A toString() 0 15 3
1
<?php
2
3
namespace Deployer\Component\PharUpdate\Version;
4
5
/**
6
 * Dumps the Version instance to a variety of formats.
7
 *
8
 * @author Kevin Herrera <[email protected]>
9
 */
10
class Dumper
11
{
12
    /**
13
     * Returns the components of a Version instance.
14
     *
15
     * @param Version $version A version.
16
     *
17
     * @return array The components.
18
     */
19
    public static function toComponents(Version $version)
20
    {
21
        return array(
22
            Parser::MAJOR => $version->getMajor(),
23
            Parser::MINOR => $version->getMinor(),
24
            Parser::PATCH => $version->getPatch(),
25
            Parser::PRE_RELEASE => $version->getPreRelease(),
26
            Parser::BUILD => $version->getBuild()
27
        );
28
    }
29
30
    /**
31
     * Returns the string representation of a Version instance.
32
     *
33
     * @param Version $version A version.
34
     *
35
     * @return string The string representation.
36
     */
37
    public static function toString(Version $version)
38
    {
39
        return sprintf(
40
            '%d.%d.%d%s%s',
41
            $version->getMajor(),
42
            $version->getMinor(),
43
            $version->getPatch(),
44
            $version->getPreRelease()
45
                ? '-' . join('.', $version->getPreRelease())
46
                : '',
47
            $version->getBuild()
48
                ? '+' . join('.', $version->getBuild())
49
                : ''
50
        );
51
    }
52
}
53