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   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 76.92%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 40
ccs 10
cts 13
cp 0.7692
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
B less() 0 20 5
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