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.

ArrayHydrator::hydrateArray()   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 2
crap 3
1
<?php
2
/******************************************************************************
3
 * Copyright (c) 2017 Constantin Galbenu <[email protected]>             *
4
 ******************************************************************************/
5
6
namespace Gica\Serialize\ObjectHydrator;
7
8
9
class ArrayHydrator
10
{
11
12
    /**
13
     * @var ObjectHydrator
14
     */
15
    private $objectHydrator;
16
17 1
    public function __construct(
18
        ObjectHydrator $objectHydrator
19
    )
20
    {
21 1
        $this->objectHydrator = $objectHydrator;
22 1
    }
23
24 1
    public function hydrateArray(string $objectClass, $serializedValue)
25
    {
26 1
        $result = [];
27
28 1
        $serializedValue = $serializedValue ?: [];
29
30 1
        foreach ($serializedValue as $value) {
31 1
            $result[] = $this->objectHydrator->hydrateObject($objectClass, $value);
32
        }
33 1
        return $result;
34
    }
35
36 1
    public function getObjectHydrator(): ObjectHydrator
37
    {
38 1
        return $this->objectHydrator;
39
    }
40
}