Conditions | 6 |
Paths | 5 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 6.027 |
Changes | 0 |
1 | <?php |
||
29 | 1 | public function getRecipientIds(): array |
|
30 | { |
||
31 | 1 | $recipientIds = []; |
|
32 | |||
33 | 1 | foreach ($this->messages as $message) { |
|
34 | 1 | if ($message->isEmpty()) { |
|
35 | continue; |
||
36 | } |
||
37 | |||
38 | 1 | $recipientId = $message->getRecipientId(); |
|
39 | |||
40 | 1 | if ($recipientId === null || $recipientId === UserEnum::USER_NOONE) { |
|
41 | 1 | continue; |
|
42 | } |
||
43 | |||
44 | 1 | if (!in_array($recipientId, $recipientIds)) { |
|
45 | 1 | $recipientIds[] = $recipientId; |
|
46 | } |
||
47 | } |
||
48 | |||
49 | 1 | return $recipientIds; |
|
50 | } |
||
74 |