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