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::__construct()   B

Complexity

Conditions 8
Paths 6

Size

Total Lines 21
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 8

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 21
ccs 13
cts 13
cp 1
rs 7.1428
c 1
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
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