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.

ArraySerializer::convertArray()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 6
cts 6
cp 1
rs 9.9
c 0
b 0
f 0
cc 3
nc 4
nop 1
crap 3
1
<?php
2
/******************************************************************************
3
 * Copyright (c) 2017 Constantin Galbenu <[email protected]>             *
4
 ******************************************************************************/
5
6
namespace Gica\Serialize\ObjectSerializer;
7
8
9
class ArraySerializer
10
{
11
    /**
12
     * @var ObjectSerializer
13
     */
14
    private $objectSerializer;
15
16 1
    public function __construct(
17
        ObjectSerializer $objectSerializer
18
    )
19
    {
20 1
        $this->objectSerializer = $objectSerializer;
21 1
    }
22
23 1
    public function convertArray($array)
24
    {
25 1
        $result = [];
26
27 1
        $array = $array ?: [];
28
29 1
        foreach ($array as $value) {
30 1
            $result[] = $this->objectSerializer->convert($value);
31
        }
32 1
        return $result;
33
    }
34
}