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 ( 0c6bcd...b3f485 )
by Andy
11s
created

DockerPortMapping::less()   B

Complexity

Conditions 5
Paths 5

Size

Total Lines 20
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 5.675

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 20
ccs 7
cts 10
cp 0.7
rs 8.8571
c 1
b 0
f 0
cc 5
eloc 10
nc 5
nop 2
crap 5.675
1
<?php
2
/**
3
 * @package: chapi
4
 *
5
 * @author: bthapaliya
6
 * @since: 2016-10-16
7
 *
8
 */
9
namespace Chapi\Entity\Marathon\AppEntity;
10
11
use Chapi\Entity\Marathon\MarathonEntityUtils;
12
13
class DockerPortMapping
14
{
15
    const DIC = self::class;
16
17
    public $containerPort = 0;
18
19
    public $hostPort = 0;
20
21
    public $servicePort = 0;
22
23
    public $protocol = 'tcp';
24
25
    public $name = null;
26
27 5
    public function __construct($data = [])
28
    {
29 5
        MarathonEntityUtils::setAllPossibleProperties($data, $this);
30 5
    }
31
32 1
    public static function less(DockerPortMapping $left, DockerPortMapping $right)
33
    {
34 1
        if ($left->containerPort != $right->containerPort) {
35
            return $left->containerPort - $right->containerPort;
36
        }
37
38 1
        if ($left->hostPort != $right->hostPort) {
39
            return $left->hostPort - $right->hostPort;
40
        }
41
42 1
        if ($left->servicePort != $right->servicePort) {
43 1
            return $left->servicePort - $right->servicePort;
44
        }
45
46 1
        if ($left->protocol != $right->protocol) {
47
            return strcmp($left->protocol, $right->protocol);
48
        }
49
50 1
        return strcmp($left->name, $right->name);
51
    }
52
}
53