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

Complexity

Conditions 4
Paths 3

Size

Total Lines 19
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 4.016

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 9
cts 10
cp 0.9
rs 9.2
c 0
b 0
f 0
cc 4
eloc 9
nc 3
nop 1
crap 4.016
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
}