Conditions | 3 |
Paths | 3 |
Total Lines | 24 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 3.0026 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 1 | public function distributeMessageCollection( |
|
21 | MessageCollectionInterface $messageCollection, |
||
22 | int $senderId = UserEnum::USER_NOONE, |
||
23 | int $category = PrivateMessageFolderSpecialEnum::PM_SPECIAL_SYSTEM, |
||
24 | string $header = null |
||
25 | ): void { |
||
26 | 1 | foreach ($messageCollection->getRecipientIds() as $recipientId) { |
|
27 | 1 | $informations = $messageCollection->getInformationDump($recipientId); |
|
28 | |||
29 | 1 | if ($header !== null) { |
|
30 | 1 | $pm = sprintf( |
|
31 | 1 | "%s\n\n%s", |
|
32 | 1 | $header, |
|
33 | 1 | $informations->getInformationsAsString() |
|
34 | 1 | ); |
|
35 | } else { |
||
36 | $pm = $informations->getInformationsAsString(); |
||
37 | } |
||
38 | |||
39 | 1 | $this->privateMessageSender->send( |
|
40 | 1 | $senderId, |
|
41 | 1 | $recipientId, |
|
42 | 1 | $pm, |
|
43 | 1 | $category |
|
44 | 1 | ); |
|
48 |