Conditions | 4 |
Paths | 5 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
16 | 2 | public function normalize(array $authorList) |
|
17 | { |
||
18 | 2 | $normalizeList = []; |
|
19 | 2 | foreach ($authorList as $author) { |
|
20 | 2 | $normalizedAuthor = [self::KEY_NAME => $author->getName()]; |
|
21 | 2 | if ($author->getEmail()) { |
|
22 | 2 | $normalizedAuthor[self::KEY_EMAIL] = $author->getEmail(); |
|
23 | 2 | } |
|
24 | 2 | if ($author->getRole()) { |
|
25 | 2 | $normalizedAuthor[self::KEY_ROLE] = $author->getRole(); |
|
26 | 2 | } |
|
27 | 2 | $normalizeList[] = $normalizedAuthor; |
|
28 | 2 | } |
|
29 | |||
30 | 2 | return $normalizeList; |
|
31 | } |
||
32 | } |
||
33 |