Passed
Pull Request — master (#5)
by Yo
02:29
created

ScriptListNormalizer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 9 2
1
<?php
2
namespace Yoanm\ComposerConfigManager\Application\Serializer\Normalizer;
3
4
use Yoanm\ComposerConfigManager\Domain\Model\Script;
5
6
class ScriptListNormalizer
7
{
8
    /**
9
     * @param Script[] $scriptList
10
     *
11
     * @return array
12
     */
13 2
    public function normalize(array $scriptList)
14
    {
15 2
        $normalizeList = [];
16 2
        foreach ($scriptList as $script) {
17 2
            $normalizeList[$script->getName()][] = $script->getCommand();
18 2
        }
19
20 2
        return $normalizeList;
21
    }
22
}
23