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::toString()   A

Complexity

Conditions 3
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
nc 1
nop 1
dl 0
loc 15
ccs 0
cts 15
cp 0
crap 12
rs 9.7666
c 0
b 0
f 0
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