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

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 26
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A convertArray() 0 11 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
}