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   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 1
dl 0
loc 55
ccs 22
cts 22
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
C __construct() 0 32 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
}