Skip to content

Commit

Permalink
Merge pull request #7 from 7span/fix-component
Browse files Browse the repository at this point in the history
Removed array operation for component
  • Loading branch information
kajal-7span authored Dec 14, 2023
2 parents 82ca0fa + 5396dce commit 6039097
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/WhatsApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ class WhatsApp implements WhatsAppInterface
{
/**
* @param string $to
*
*
* @param string $templateName
*
*
* @param string $languageCode
*
*
* @param string $accessToken
*
*
* @param string $fromPhoneNumberId
*
*
* @param array $components
*
*
* @param string $messages
*
*
* @return array|mixed
*/
public function sendTemplateMessage(string $to, string $templateName, string $languageCode, string $accessToken = '', string $fromPhoneNumberId = '', array $components = [], string $messages = '')
Expand Down Expand Up @@ -103,15 +103,15 @@ private function formateParametersData($messages)
/**
*
* @param string $to
*
*
* @param string $templateName
*
*
* @param string $languageCode
*
*
* @param array $components
*
*
* @param string $messages
*
*
* @return array|mixed
*/
public function createBody($to, $templateName, $languageCode, $components = [], $messages = '')
Expand All @@ -130,7 +130,7 @@ public function createBody($to, $templateName, $languageCode, $components = [],
];

if (!empty($components)) {
array_push($body['template']['components'], $components);
$body['template']['components'] = $components;
} else {
array_push(
$body['template']['components'],
Expand Down

0 comments on commit 6039097

Please sign in to comment.