Skip to content

Commit 5203017

Browse files
committed
TASK: dispatch options parameter instead of attachedResources for multi purpose
1 parent f8dd5fe commit 5203017

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

Classes/Channel/ChannelInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ interface ChannelInterface
1919
* @param Recipient $recipient
2020
* @param string $subject
2121
* @param string $text
22-
* @param array $attachedResources
22+
* @param array $options
2323
* @return void
2424
*/
25-
public function send(Recipient $recipient, $subject, $text, $attachedResources = array());
25+
public function send(Recipient $recipient, $subject, $text, $options = array());
2626
}

Classes/Channel/EmailChannel.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,15 @@ function __construct(array $options = [])
5959
* @param Recipient $recipient
6060
* @param string $subject
6161
* @param string $text
62-
* @param array $attachedResources
62+
* @param array $options
6363
* @return void
6464
* @throws Exception
6565
*/
66-
public function send(Recipient $recipient, $subject, $text, $attachedResources = array())
66+
public function send(Recipient $recipient, $subject, $text, $options = array())
6767
{
6868
$toEmail = $recipient->getEmail();
6969
$toName = $recipient->getName();
70+
$attachedResources = $options['attachedResources'] ?? [];
7071

7172
if (empty($toEmail)) {
7273
throw new Exception('Recipient has no email address', 1570541186);

Classes/Channel/NotificationChannel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ class NotificationChannel implements ChannelInterface
2525
* @param Recipient $recipient
2626
* @param string $subject
2727
* @param string $text
28-
* @param array $attachedResources
28+
* @param array $options
2929
* @throws Exception
3030
*/
31-
public function send(Recipient $recipient, $subject, $text, $attachedResources = array())
31+
public function send(Recipient $recipient, $subject, $text, $options = array())
3232
{
3333
if ($recipient->getPerson() instanceof Person) {
3434
$newNotification = $this->createNotification($recipient, $subject, $text);

Classes/Channel/VoidChannel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ class VoidChannel implements ChannelInterface
2020
* @param Recipient $recipient
2121
* @param string $subject
2222
* @param string $text
23-
* @param array $attachedResources
23+
* @param array $options
2424
* @throws Exception
2525
*/
26-
public function send(Recipient $recipient, $subject, $text, $attachedResources = array())
26+
public function send(Recipient $recipient, $subject, $text, $options = array())
2727
{
2828
}
2929
}

Classes/Dispatcher/Dispatcher.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ public function setChannelInterface(ChannelInterface $channelInterface = null)
3838
* @param string $subject
3939
* @param string $text
4040
* @param array $params
41-
* @param array $attachedResources
41+
* @param array $options
4242
* @return void
4343
*/
44-
public function dispatch(Recipient $recipient, $subject, $text, $params = array(), $attachedResources = array())
44+
public function dispatch(Recipient $recipient, $subject, $text, $params = array(), $options = array())
4545
{
4646
$renderedSubject = $this->messageService->renderSubject($subject, $params);
4747
$renderedText = $this->messageService->renderText($text, $params);
4848

49-
$this->channelInterface->send($recipient, $renderedSubject, $renderedText, $attachedResources);
49+
$this->channelInterface->send($recipient, $renderedSubject, $renderedText, $options);
5050
}
5151
}

Classes/Dispatcher/DispatcherInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public function setChannelInterface(ChannelInterface $channelInterface);
2727
* @param string $subject
2828
* @param string $text
2929
* @param array $params
30-
* @param array $attachedResources
30+
* @param array $options
3131
* @return void
3232
*/
33-
public function dispatch(Recipient $recipient, $subject, $text, $params = array(), $attachedResources = array());
33+
public function dispatch(Recipient $recipient, $subject, $text, $params = array(), $options = array());
3434
}

0 commit comments

Comments
 (0)