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 ( 42287f...fba610 )
by Andy
03:33
created

ContainerEntity   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 21 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
class ContainerEntity
12
{
13
    /**
14
     * @param array|object $jobData
15
     * @throws \InvalidArgumentException
16
     */
17 6
    public function __construct($jobData = [])
18
    {
19 6
        if (is_array($jobData) || is_object($jobData)) {
20 5
            foreach ($jobData as $key => $value) {
21 1
                if (property_exists($this, $key)) {
22 1
                    if ($key == 'type') {
23 1
                        $this->{$key} = strtolower($value);
24 1
                    } elseif ($key == 'volumes') {
25 1
                        foreach ($value as $valueVolume) {
26 1
                            $volume = new ContainerVolumeEntity($valueVolume);
27 1
                            $this->volumes[] = $volume;
28
                        }
29
                    } else {
30 5
                        $this->{$key} = $value;
31
                    }
32
                }
33
            }
34
        } else {
35 1
            throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__));
36
        }
37 5
    }
38
    
39
    /** @var string  */
40
    public $type = '';
41
    
42
    /** @var string  */
43
    public $image = '';
44
    
45
    /** @var string  */
46
    public $network = '';
47
    
48
    /** @var ContainerVolumeEntity[] */
49
    public $volumes = [];
50
    
51
    /** @var bool  */
52
    public $forcePullImage = false;
53
}
54