Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [4.0.1] - 2026-10-20
### Fixed
- `curl_close()` deprecation on PHP-8.5
- `TypeError` thrown instead of `NetworkException` when cURL handle cannot be initialized
- cURL handle not closed on failed request on PHP-7, `HttpClient` issue

## [4.0.0] - 2026-04-09
### Removed
- deprecated `\Smsapi\Client\Feature\Contacts\Bag\CreateContactBag::withPhone`
Expand All @@ -13,7 +19,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
- deprecated `\Smsapi\Client\Curl\Exception\NetworkException`
- deprecated `\Smsapi\Client\Curl\Exception\ClientException`

## Changed
### Changed
- method signature `\Smsapi\Client\Feature\Contacts\ContactsFeature::findContacts`
- method signature `\Smsapi\Client\Feature\Sms\Bag\ScheduleSmsBag::setExternalId`
- method signature `\Smsapi\Client\Feature\Sms\Bag\ScheduleSmssBag::setExternalId`
Expand Down
3 changes: 3 additions & 0 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include $(CURDIR)/php-8.1/Makefile
include $(CURDIR)/php-8.2/Makefile
include $(CURDIR)/php-8.3/Makefile
include $(CURDIR)/php-8.4/Makefile
include $(CURDIR)/php-8.5/Makefile

help:
@grep -hE '^[a-zA-Z0-9_.-]+:.*?## .*$$' $(MAKEFILE_LIST) \
Expand All @@ -30,6 +31,7 @@ test: ## test all against all php images
$(MAKE) test-php-8.2
$(MAKE) test-php-8.3
$(MAKE) test-php-8.4
$(MAKE) test-php-8.5

test-unit: ## test unit suite against all php images
$(MAKE) test-suite-php-7.0 SUITE=unit
Expand All @@ -42,5 +44,6 @@ test-unit: ## test unit suite against all php images
$(MAKE) test-suite-php-8.2 SUITE=unit
$(MAKE) test-suite-php-8.3 SUITE=unit
$(MAKE) test-suite-php-8.4 SUITE=unit
$(MAKE) test-suite-php-8.5 SUITE=unit

.DEFAULT_GOAL := help
2 changes: 0 additions & 2 deletions build/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.5'

services:

php-7.0:
Expand Down
2 changes: 1 addition & 1 deletion build/php-7.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM composer:2.2 as composer
FROM composer:2.2 AS composer
FROM php:7.0-cli-alpine

RUN apk update && \
Expand Down
2 changes: 1 addition & 1 deletion build/php-7.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM composer:2.2 as composer
FROM composer:2.2 AS composer
FROM php:7.1-cli-alpine

RUN apk update && \
Expand Down
2 changes: 1 addition & 1 deletion build/php-7.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM composer:2.2 as composer
FROM composer:latest AS composer
FROM php:7.2-cli-alpine

RUN apk update && \
Expand Down
2 changes: 1 addition & 1 deletion build/php-7.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM composer:2.2 as composer
FROM composer:latest AS composer
FROM php:7.3-cli-alpine

RUN apk update && \
Expand Down
2 changes: 1 addition & 1 deletion build/php-7.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM composer:2.2 as composer
FROM composer:latest AS composer
FROM php:7.4-cli-alpine

RUN apk update && \
Expand Down
2 changes: 1 addition & 1 deletion build/php-8.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM composer:latest as composer
FROM composer:latest AS composer
FROM php:8.0-cli-alpine

RUN apk update && \
Expand Down
2 changes: 1 addition & 1 deletion build/php-8.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM composer:latest as composer
FROM composer:latest AS composer
FROM php:8.1-cli-alpine

RUN apk update && \
Expand Down
2 changes: 1 addition & 1 deletion build/php-8.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM composer:latest as composer
FROM composer:latest AS composer
FROM php:8.2-cli-alpine

RUN apk update && \
Expand Down
2 changes: 1 addition & 1 deletion build/php-8.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM composer:latest as composer
FROM composer:latest AS composer
FROM php:8.3-cli-alpine

RUN apk update && \
Expand Down
12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,17 @@
"suggest": {
"ext-curl": "To use Curl HttpClient",
"guzzlehttp/psr7": "To use Curl HttpClient and HTTP message factories"
},
"config": {
"policy": {
"advisories": {
"ignore-id": {
"PKSA-xz3r-9gp4-4m1z": "CVE-2026-109413: Unbounded Recursion in the YAML Inline Lexer Lets a Single Document Crash the Process - require-dev dependency, not applicable",
"PKSA-v5yj-8nmz-sk2q": "CVE-2026-45304: YAML Parser Exponential Memory Allocation via Recursive Collection-Alias Expansion - require-dev dependency, not applicable",
"PKSA-ft77-7h5f-p3r6": "CVE-2026-45305: YAML Parser ReDoS via Catastrophic Backtracking in Parser::cleanup() Regex - require-dev dependency, not applicable",
"PKSA-b14r-zh1d-vdrc": "CVE-2026-45133: YAML Parser Stack Exhaustion via Unbounded Recursion in Nested Blocks, Sequences, and Mappings - require-dev dependency, not applicable"
}
}
}
}
}
11 changes: 6 additions & 5 deletions src/Curl/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ public function sendRequest(RequestInterface $request): ResponseInterface
$this->prepareRequestHeaders($request, $httpClient);
$this->prepareResponseOptions($httpClient);

$response = $this->execute($request, $httpClient);

$this->closeHttpClient($httpClient);
try {
$response = $this->execute($request, $httpClient);
} finally {
$this->closeHttpClient($httpClient);
}

return $response;
}
Expand Down Expand Up @@ -103,8 +105,7 @@ private function execute(RequestInterface $request, $httpClient): ResponseInterf

private function closeHttpClient($httpClient)
{
// curl_close() has no effect since PHP 8.0 and is deprecated since PHP 8.5
if (PHP_VERSION_ID < 80000) {
if (is_resource($httpClient)) {
curl_close($httpClient);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/SmsapiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
interface SmsapiClient extends LoggerAwareInterface
{
const VERSION = '4.0.0';
const VERSION = '4.0.1';

public function smsapiPlService(string $apiToken): SmsapiPlService;

Expand Down
Loading