From 56042c35eb01bf39a23000af6996204571dced6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Wed, 20 Mar 2024 13:36:18 +0900 Subject: [PATCH] feat: deprecate support for PHP versions older than 8.1 Older versions have reached EOL, and support for them will be removed in next major release --- README.md | 6 +----- src/Api/FingerprintApi.php | 8 ++++++++ template/README.mustache | 6 +----- template/api.mustache | 8 ++++++++ 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e0a9122f..ccff6ef9 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,9 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git This library supports the following PHP implementations: -- PHP 7.1 -- PHP 7.2 -- PHP 7.3 -- PHP 7.4 -- PHP 8.0 - PHP 8.1 - PHP 8.2 +- PHP 8.3 We currently don't support external PHP Runtimes like: diff --git a/src/Api/FingerprintApi.php b/src/Api/FingerprintApi.php index 8672959b..633164e7 100644 --- a/src/Api/FingerprintApi.php +++ b/src/Api/FingerprintApi.php @@ -78,6 +78,14 @@ public function __construct( $this->client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); + + if(version_compare( + PHP_VERSION, + '8.1', + '<' + )) { + trigger_error('You are using a PHP version that has reached EOL. Support for it will be removed in next major release of this SDK. Please consider upgrading to PHP 8.1 or higher.', E_USER_WARNING); + } } /** diff --git a/template/README.mustache b/template/README.mustache index 77a5cae2..d5fe3228 100644 --- a/template/README.mustache +++ b/template/README.mustache @@ -54,13 +54,9 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git This library supports the following PHP implementations: -- PHP 7.1 -- PHP 7.2 -- PHP 7.3 -- PHP 7.4 -- PHP 8.0 - PHP 8.1 - PHP 8.2 +- PHP 8.3 We currently don't support external PHP Runtimes like: diff --git a/template/api.mustache b/template/api.mustache index e2cd5cda..9346a8bf 100644 --- a/template/api.mustache +++ b/template/api.mustache @@ -69,6 +69,14 @@ use {{invokerPackage}}\ObjectSerializer; $this->client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); + + if(version_compare( + PHP_VERSION, + '8.1', + '<' + )) { + trigger_error('You are using a PHP version that has reached EOL. Support for it will be removed in next major release of this SDK. Please consider upgrading to PHP 8.1 or higher.', E_USER_WARNING); + } } /**