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 ( 1f66b1...151e35 )
by Marc
11:28
created

HealthCheck   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 50%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 48
ccs 5
cts 10
cp 0.5
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
A jsonSerialize() 0 8 2
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\AppEntity\HealthCheckCommand;
12
use Chapi\Entity\Marathon\MarathonEntityUtils;
13
14
class HealthCheck implements \JsonSerializable
15
{
16
17
    const DIC = self::class;
18
19
    public $protocol = 'HTTP';
20
21
    public $path = '/';
22
23
    public $gracePeriodSeconds = 300;
24
25
    public $intervalSeconds = 60;
26
27
    public $portIndex = 0;
28
29
    public $port = null;
30
31
    public $timeoutSeconds = 20;
32
33
    public $maxConsecutiveFailures = 3;
34
35
    /**
36
     * @var HealthCheckCommand
37
     */
38
    public $command = null;
39
40 2
    public function __construct($aData = [])
41
    {
42 2
        MarathonEntityUtils::setAllPossibleProperties($aData, $this);
43
44 2
        if (isset($aData['command']))
45
        {
46 1
            $this->command = new HealthCheckCommand((array) $aData['command']);
47
        }
48 2
    }
49
50
    /**
51
     * @inheritdoc
52
     */
53
    function jsonSerialize()
54
    {
55
        $_aRet = (array) $this;
56
        if (is_null($this->port))
57
        {
58
            unset($_aRet["port"]);
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal port does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
59
        }
60
    }
61
}