From 1c5b2d150d9fd2a95bd82ccb2d777db44cfd95c7 Mon Sep 17 00:00:00 2001 From: rajmundtoth0 Date: Tue, 23 Sep 2025 09:22:30 +0200 Subject: [PATCH 1/3] Declare nullable params explicitly null. --- src/Factory.php | 2 +- src/Request/Customer.php | 2 +- src/Response/AbstractResponse.php | 4 ++-- src/Serializer/ResponseSerializer.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Factory.php b/src/Factory.php index f5b9899..49082c7 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -63,7 +63,7 @@ class Factory * @return T * @throws ClassDoesNotExistsException */ - public static function create($class, Authentication $authentication = null) + public static function create($class, ?Authentication $authentication = null) { if (class_exists($class)) { return new $class($authentication); diff --git a/src/Request/Customer.php b/src/Request/Customer.php index f04cb8e..2b98747 100644 --- a/src/Request/Customer.php +++ b/src/Request/Customer.php @@ -267,7 +267,7 @@ class Customer extends AbstractSerializer * * @param Address|null $billingAddress Billing address */ - public function __construct(Address $billingAddress = null) + public function __construct(?Address $billingAddress = null) { $this->billing = $billingAddress; } diff --git a/src/Response/AbstractResponse.php b/src/Response/AbstractResponse.php index c15783c..d6fac30 100644 --- a/src/Response/AbstractResponse.php +++ b/src/Response/AbstractResponse.php @@ -49,7 +49,7 @@ abstract class AbstractResponse * @return void * @throws \InvalidArgumentException */ - public function headerSetter(\SimpleXMLElement $xml = null) + public function headerSetter(?\SimpleXMLElement $xml = null) { if ($xml) { $this->Header = ResponseSerializer::serialize(Header::class, $xml); @@ -64,7 +64,7 @@ public function headerSetter(\SimpleXMLElement $xml = null) * @return static * @throws \InvalidArgumentException */ - public function deserialize(\SimpleXMLElement $xml = null) + public function deserialize(?\SimpleXMLElement $xml = null) { $object = clone $this; diff --git a/src/Serializer/ResponseSerializer.php b/src/Serializer/ResponseSerializer.php index 7403e27..ecb0908 100644 --- a/src/Serializer/ResponseSerializer.php +++ b/src/Serializer/ResponseSerializer.php @@ -45,7 +45,7 @@ class ResponseSerializer public static function serialize( $objectName, \SimpleXMLElement $data, - \SimpleXMLElement $header = null + ?\SimpleXMLElement $header = null ) { $object = new $objectName(); $object->headerSetter($header); From f45581897f6e252c83e14ffa1575ad173d08f66a Mon Sep 17 00:00:00 2001 From: Shahbaz Date: Thu, 9 Oct 2025 15:35:03 +0500 Subject: [PATCH 2/3] Update sdk version and release notes --- CHANGELOG.md | 4 ++++ composer.json | 2 +- src/AbstractApi.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3cd6bd..942fbbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.5.5] - 2025-10-09 +### Fixes +- Fix deprecation warnings on PHP 8.4 + ## [3.5.4] - 2025-09-12 ### Added - Provide `setFormTemplate` method to set `form_template` for the `createPaymentRequest`. diff --git a/composer.json b/composer.json index 464c6f7..3e2f6c2 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ] }, "require": { - "php": "^7.0 || ^8.0", + "php": "^7.1 || ^8.0", "ext-date": "*", "ext-filter": "*", "ext-mbstring": "*", diff --git a/src/AbstractApi.php b/src/AbstractApi.php index d5eba3f..0b66785 100644 --- a/src/AbstractApi.php +++ b/src/AbstractApi.php @@ -55,7 +55,7 @@ abstract class AbstractApi /** * PHP API version */ - const PHP_API_VERSION = '3.5.3'; + const PHP_API_VERSION = '3.5.5'; /** * Event dispatcher From 6df475a639b32b4df6c7dce29c682049d57f52bb Mon Sep 17 00:00:00 2001 From: Shahbaz Date: Thu, 9 Oct 2025 15:44:22 +0500 Subject: [PATCH 3/3] Update supported PHP versions --- CHANGELOG.md | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 942fbbc..2de8e7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [3.5.5] - 2025-10-09 ### Fixes - Fix deprecation warnings on PHP 8.4 +- Restrict supported PHP versions to 7.1 and above. ## [3.5.4] - 2025-09-12 ### Added diff --git a/README.md b/README.md index bad80c2..c248c36 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ try { ## Requirements -The AltaPay API PHP requires PHP 7.0.0 or greater with the following extensions installed: +The AltaPay API PHP requires PHP 7.1.0 or greater with the following extensions installed: - date - filter