Passed
Push — master ( 80b57f...2460a5 )
by Yo
02:49
created

AutoloadListNormalizer   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 13 4
1
<?php
2
namespace Yoanm\ComposerConfigManager\Application\Serializer\Normalizer;
3
4
use Yoanm\ComposerConfigManager\Domain\Model\Autoload;
5
6
class AutoloadListNormalizer
7
{
8
    /**
9
     * @param Autoload[] $autoloadList
10
     *
11
     * @return array
12
     */
13 2
    public function normalize(array $autoloadList)
14
    {
15 2
        $normalizeList = [];
16 2
        foreach ($autoloadList as $autoload) {
17 2
            if (count($autoload->getEntryList())) {
18 2
                foreach ($autoload->getEntryList() as $entry) {
19 2
                    $normalizeList[$autoload->getType()][$entry->getNamespace()] = $entry->getPath();
20 2
                }
21 2
            }
22 2
        }
23
24 2
        return $normalizeList;
25
    }
26
}
27