From 1baa6168fa4e4572b89be01f66615a2e39bea368 Mon Sep 17 00:00:00 2001 From: crocodele Date: Mon, 20 Nov 2017 00:12:31 +0200 Subject: [PATCH] Replace keys instead of combining when merging multi-dimensional arrays (#21) --- src/SlackDriver.php | 2 +- src/SlackRTMDriver.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SlackDriver.php b/src/SlackDriver.php index 67d5cac..77a207b 100644 --- a/src/SlackDriver.php +++ b/src/SlackDriver.php @@ -312,7 +312,7 @@ protected function respondJSON($message, $matchingMessage, $parameters = []) */ protected function replyWithToken($message, $matchingMessage, $additionalParameters = []) { - $parameters = array_merge_recursive([ + $parameters = array_replace_recursive([ 'as_user' => true, 'token' => $this->payload->get('token'), 'channel' => $matchingMessage->getRecipient() === '' ? $matchingMessage->getSender() : $matchingMessage->getRecipient(), diff --git a/src/SlackRTMDriver.php b/src/SlackRTMDriver.php index 2f74551..dd2fe3e 100644 --- a/src/SlackRTMDriver.php +++ b/src/SlackRTMDriver.php @@ -214,7 +214,7 @@ protected function isBot() */ public function buildServicePayload($message, $matchingMessage, $additionalParameters = []) { - $parameters = array_merge_recursive([ + $parameters = array_replace_recursive([ 'channel' => $matchingMessage->getRecipient() ?: $matchingMessage->getSender(), 'as_user' => true, ], $additionalParameters);