Skip to content

Commit

Permalink
feat: deprecate support for PHP versions older than 8.1
Browse files Browse the repository at this point in the history
Older versions have reached EOL, and support for them will be removed in next major release
  • Loading branch information
TheUnderScorer committed Mar 20, 2024
1 parent ed1f294 commit 56042c3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
8 changes: 8 additions & 0 deletions src/Api/FingerprintApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down
6 changes: 1 addition & 5 deletions template/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
8 changes: 8 additions & 0 deletions template/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down

0 comments on commit 56042c3

Please sign in to comment.