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.

JobCollection::__construct()   A
last analyzed

Complexity

Conditions 4
Paths 3

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 4.016

Importance

Changes 0
Metric Value
dl 0
loc 16
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
use Chapi\Entity\Chronos\ChronosJobEntity;
14
use Chapi\Entity\JobEntityInterface;
15
16
class JobCollection extends \ArrayObject
17
{
18
19
    /**
20
     * (PHP 5 &gt;= 5.0.0)<br/>
21
     * Construct a new array object
22
     * @link http://php.net/manual/en/arrayobject.construct.php
23
     *
24
     * @param ChronosJobEntity[] $jobEntities The input parameter accepts an array of \Chapi\Entity\Chronos\JobEntity.
25
     * @throws \InvalidArgumentException
26
     */
27 27
    public function __construct(array $jobEntities)
28
    {
29 27
        $jobs = [];
30
31 27
        if (count($jobEntities) > 0) {
32 24
            $check = current($jobEntities);
33 24
            if (!$check instanceof JobEntityInterface) {
34
                throw new \InvalidArgumentException('array has to contain JobEntity objects');
35
            }
36
37 24
            foreach ($jobEntities as $jobEntity) {
38 24
                $jobs[$jobEntity->getKey()] = $jobEntity;
39
            }
40
        }
41 27
        parent::__construct($jobs);
42 27
    }
43
}
44