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 (#60)
by Marc
02:41
created

ContainerEntity::__construct()   C

Complexity

Conditions 8
Paths 6

Size

Total Lines 32
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 22
CRAP Score 8

Importance

Changes 0
Metric Value
dl 0
loc 32
ccs 22
cts 22
cp 1
rs 5.3846
c 0
b 0
f 0
cc 8
eloc 14
nc 6
nop 1
crap 8
1
<?php
2
/**
3
 * @package: chapi
4
 *
5
 * @author:  msiebeneicher
6
 * @since:   2016-11-04
7
 */
8
9
namespace Chapi\Entity\Chronos\JobEntity;
10
11
12
class ContainerEntity
13
{
14
    /**
15
     * @param array|object $mJobData
16
     * @throws \InvalidArgumentException
17
     */
18 5
    public function __construct($mJobData = [])
19
    {
20 5
        if (is_array($mJobData) || is_object($mJobData))
21 5
        {
22 4
            foreach ($mJobData as $_sKey => $_mValue)
23
            {
24 1
                if (property_exists($this, $_sKey))
25 1
                {
26 1
                    if ($_sKey == 'type')
27 1
                    {
28 1
                        $this->{$_sKey} = strtolower($_mValue);
29 1
                    }
30 1
                    elseif ($_sKey == 'volumes')
31
                    {
32 1
                        foreach ($_mValue as $_mValueVolume)
33
                        {
34 1
                            $_oVolume = new ContainerVolumeEntity($_mValueVolume);
35 1
                            $this->volumes[] = $_oVolume;
36 1
                        }
37 1
                    }
38
                    else
39
                    {
40 1
                        $this->{$_sKey} = $_mValue;
41
                    }
42 1
                }
43 4
            }
44 4
        }
45
        else
46
        {
47 1
            throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__));
48
        }
49 4
    }
50
    
51
    /** @var string  */
52
    public $type = '';
53
    
54
    /** @var string  */
55
    public $image = '';
56
    
57
    /** @var string  */
58
    public $network = '';
59
    
60
    /** @var ContainerVolumeEntity[] */
61
    public $volumes = [];
62
    
63
    /** @var bool  */
64
    public $forcePullImage = false;
65
    
66
}