From 55491265e59e504d352172a668c491aec1660941 Mon Sep 17 00:00:00 2001 From: hexonthebeach Date: Fri, 12 Dec 2025 12:20:35 +0100 Subject: [PATCH 1/3] Update to test 8.5 compatibility --- .github/workflows/main.yml | 4 ++-- src/CMText/RichContent/Messages/TextMessage.php | 4 ++-- src/CMText/TextClient.php | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 95d40a3..33862bd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: ['7.1', '7.4', '8.0', '8.4'] + version: ['7.1', '7.4', '8.0', '8.5'] max-parallel: 2 steps: @@ -41,7 +41,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: ['7.1', '7.4', '8.0', '8.4'] + version: ['7.1', '7.4', '8.0', '8.5'] max-parallel: 1 steps: diff --git a/src/CMText/RichContent/Messages/TextMessage.php b/src/CMText/RichContent/Messages/TextMessage.php index 6e9485b..ac5d547 100644 --- a/src/CMText/RichContent/Messages/TextMessage.php +++ b/src/CMText/RichContent/Messages/TextMessage.php @@ -27,9 +27,9 @@ class TextMessage implements IRichMessage /** * TextMessage constructor. * @param string $Text - * @param string $Tag + * @param string|null $Tag */ - public function __construct(string $Text, string $Tag = null) + public function __construct(string $Text, $Tag = null) { $this->text = $Text; $this->tag = $Tag; diff --git a/src/CMText/TextClient.php b/src/CMText/TextClient.php index b98bd8f..789677d 100644 --- a/src/CMText/TextClient.php +++ b/src/CMText/TextClient.php @@ -111,6 +111,7 @@ public function send( ], CURLOPT_TIMEOUT => 20, CURLOPT_CONNECTTIMEOUT => 5, + CURLOPT_FORBID_REUSE => true, ]); $response = curl_exec($ch); @@ -124,9 +125,6 @@ public function send( }catch (\Exception $exception){ $response = json_encode(['details' => $exception->getMessage()]); $statuscode = TextClientStatusCodes::UNKNOWN; - - }finally{ - curl_close($ch); } $return = new TextClientResult($statuscode, $response); From e542065697a775848eb2a2f91b96a94d3bdd98b5 Mon Sep 17 00:00:00 2001 From: hexonthebeach Date: Fri, 12 Dec 2025 12:29:09 +0100 Subject: [PATCH 2/3] Improved type coalescing --- src/CMText/RichContent/Messages/TextMessage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMText/RichContent/Messages/TextMessage.php b/src/CMText/RichContent/Messages/TextMessage.php index ac5d547..ec175b6 100644 --- a/src/CMText/RichContent/Messages/TextMessage.php +++ b/src/CMText/RichContent/Messages/TextMessage.php @@ -29,7 +29,7 @@ class TextMessage implements IRichMessage * @param string $Text * @param string|null $Tag */ - public function __construct(string $Text, $Tag = null) + public function __construct(string $Text, ?string $Tag = null) { $this->text = $Text; $this->tag = $Tag; From 9bfe3422c60bd4396ad03e2d1feaf7d4329bc653 Mon Sep 17 00:00:00 2001 From: hexonthebeach Date: Fri, 12 Dec 2025 12:33:14 +0100 Subject: [PATCH 3/3] Bumped sdk version --- README.md | 2 +- composer.json | 2 +- src/CMText/TextClient.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 06f9439..ca6cb40 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A software development kit to provide ways to interact with CM.com's Text servic ### Requirements -- php 7.1 through 8.4 (inclusive) +- php 7.1 through 8.5 (inclusive) ## Usage diff --git a/composer.json b/composer.json index 33aeb8e..2caec4b 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "cmdotcom/text-sdk-php", "description": "PHP SDK to send messages with CM.com", "type": "library", - "version": "3.0.1", + "version": "3.0.2", "keywords": ["sms","cm.com","rcs","whatsapp","viber","line","wechat","imessage","twitter","instagram"], "homepage": "https://www.cm.com/products/text/", "license": "MIT", diff --git a/src/CMText/TextClient.php b/src/CMText/TextClient.php index 789677d..51edd71 100644 --- a/src/CMText/TextClient.php +++ b/src/CMText/TextClient.php @@ -32,7 +32,7 @@ class TextClient implements ITextClient /** * SDK Version constant */ - const VERSION = '3.0.1'; + const VERSION = '3.0.2'; /**