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