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 (#68)
by Marc
08:42
created

JobCollection   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 90%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 31
ccs 9
cts 10
cp 0.9
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 19 4
1
<?php
2
/**
3
 * @package: chapi
4
 *
5
 * @author:  msiebeneicher
6
 * @since:   2015-07-29
7
 *
8
 */
9
10
11
namespace Chapi\Entity\Chronos;
12
13
14
use Chapi\Entity\Chronos\ChronosJobEntity;
15
use Chapi\Entity\JobEntityInterface;
16
17
class JobCollection extends \ArrayObject
18
{
19
20
    /**
21
     * (PHP 5 &gt;= 5.0.0)<br/>
22
     * Construct a new array object
23
     * @link http://php.net/manual/en/arrayobject.construct.php
24
     *
25
     * @param ChronosJobEntity[] $aJobEntities The input parameter accepts an array of \Chapi\Entity\Chronos\JobEntity.
26
     * @throws \InvalidArgumentException
27
     */
28 27
    public function __construct(array $aJobEntities)
29
    {
30 27
        $_aJobs = [];
31
32 27
        if (count($aJobEntities) > 0)
33
        {
34 24
            $_mCheck = current($aJobEntities);
35 24
            if (!$_mCheck instanceof JobEntityInterface)
36
            {
37
                throw new \InvalidArgumentException('array has to contain JobEntity objects');
38
            }
39
40 24
            foreach ($aJobEntities as $_oJobEntity)
41
            {
42 24
                $_aJobs[$_oJobEntity->getKey()] = $_oJobEntity;
43
            }
44
        }
45 27
        parent::__construct($_aJobs);
46
    }
47
}