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.

SerializerCollection::__construct()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.6666
c 0
b 0
f 0
cc 3
eloc 5
nc 3
nop 1
crap 3
1
<?php
2
namespace Solvire\API\Serializers;
3
4
use Solvire\API\Serializers\BaseSerializer;
5
use PhpCollection\Sequence;
6
use LeadFerret\Http\Controllers\API\Serializers\HealthSerializer;
7
8
/**
9
 * 
10
 * @author solvire <[email protected]>
11
 * @package Serializers
12
 * @namespace Solvire\API\Serializers
13
 */
14
class SerializerCollection extends Sequence
15
{
16
17
    /**
18
     *
19
     *
20
     *
21
     * There isn't much to ordering here.
22
     * Just use a numeric key and we will try tro sort later
23
     *
24
     * @param
25
     *            array of parameters $sequence
26
     */
27 1
    public function __construct($serializers = [])
28
    {
29 1
        foreach ($serializers as $key => $serializer) {
30 1
            if (! ($serializer instanceof BaseSerializer)) {
31 1
                throw new \RuntimeException("Only serializer objects allowed here.");
32
            }
33 1
        }
34 1
        parent::__construct($serializers);
35 1
    }
36
37
    /**
38
     *
39
     * @return array
40
     */
41 1
    public function toArray()
42
    {
43 1
        return $this->all();
44
    }
45
46 1
    public function add($serializer)
47
    {
48 1
        if (! ($serializer instanceof BaseSerializer)) {
49 1
            throw new \RuntimeException("Only search paramater objects allowed here.");
50
        }
51 1
        return parent::add($serializer);
52
    }
53
}
54