Conditions | 4 |
Paths | 8 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
45 | public function setDefaultsForEmptyFields(SlackMessage $slackMessage, array $config): SlackMessage |
||
46 | { |
||
47 | if (!$slackMessage->getIcon()) { |
||
48 | $slackMessage->setIcon($config['default_icon']); |
||
49 | } |
||
50 | |||
51 | if (!$slackMessage->getRecipient()) { |
||
52 | $slackMessage->setRecipient($config['default_channel']); |
||
53 | } |
||
54 | |||
55 | if (!$slackMessage->getSender()) { |
||
56 | $slackMessage->setSender('SlackBot'); |
||
57 | } |
||
58 | |||
59 | return $slackMessage; |
||
60 | } |
||
61 | } |
||
62 |