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   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 1
dl 0
loc 40
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 3
A toArray() 0 4 1
A add() 0 7 2
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