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
Pull Request — master (#104)
by
unknown
06:19
created

PortDefinition   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 57.14%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 36
ccs 8
cts 14
cp 0.5714
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 2
A jsonSerialize() 0 8 1
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 PortDefinition implements \JsonSerializable
14
{
15
    const DIC = self::class;
16
    public $port = 0;
17
18
    public $protocol = 'tcp';
19
20
    public $name = null;
21
22
    public $labels = null;
23
24 5
    public function __construct($data = [])
25
    {
26 5
        MarathonEntityUtils::setAllPossibleProperties(
27 5
            (array) $data,
28 5
            $this,
29 5
            ['labels' => MarathonEntityUtils::convObject()]
30
        );
31
32 5
        if (!isset($data['labels'])) {
33 4
            $this->labels = (object) [];
34
        }
35 5
    }
36
37
    /**
38
     * @inheritdoc
39
     */
40
    public function jsonSerialize()
41
    {
42
        $return = (array) $this;
43
        $return = array_filter($return, function ($value, $key) {
0 ignored issues
show
Unused Code introduced by
The parameter $key is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
44
            return !is_null($value);
45
        }, ARRAY_FILTER_USE_BOTH);
46
        return $return;
47
    }
48
}
49