Skip to content

Commit 8eaf0ab

Browse files
authored
Merge pull request #108 from DoclerLabs/add-more-php-versions
add more php versions
2 parents ee0b3f1 + e8dee7d commit 8eaf0ab

File tree

6 files changed

+49
-2
lines changed

6 files changed

+49
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [10.7.0] - 2024.02.15
8+
### Added
9+
- Added support for php 8.1, 8.2, 8.3 constraints
10+
711
## [10.6.1] - 2024.02.10
812
### Fixed
913
- operationId containing dashes is converted to camel case

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The following environment variables are available:
7676
| `OUTPUT_DIR` | yes | | | /client |
7777
| `CODE_STYLE` | no | {path-to-repository}/.php-cs-fixer.php.dist | | /client/myCodeStyle.php |
7878
| `SOURCE_DIR` | no | src | | src |
79-
| `CLIENT_PHP_VERSION` | no | 7.4 | 7.0, 7.1, 7.2, 7.3, 7.4, 8.0 | 7.4 |
79+
| `CLIENT_PHP_VERSION` | no | 7.4 | 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 | 7.4 |
8080
| `COMPOSER_JSON_TEMPLATE_DIR` | no | {path-to-repository}/template/composer.json.twig | | /path/composer.json.twig |
8181
| `README_MD_TEMPLATE_DIR` | no | {path-to-repository}/template/README.md.twig | | /path/README.md.twig |
8282
| `HTTP_MESSAGE` | no | guzzle | guzzle, nyholm | nyholm |

src/Ast/PhpVersion.php

+9
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,22 @@ class PhpVersion
2020

2121
public const VERSION_PHP80 = 8.0;
2222

23+
public const VERSION_PHP81 = 8.1;
24+
25+
public const VERSION_PHP82 = 8.2;
26+
27+
public const VERSION_PHP83 = 8.3;
28+
2329
private const SUPPORTED_VERSIONS = [
2430
self::VERSION_PHP70,
2531
self::VERSION_PHP71,
2632
self::VERSION_PHP72,
2733
self::VERSION_PHP73,
2834
self::VERSION_PHP74,
2935
self::VERSION_PHP80,
36+
self::VERSION_PHP81,
37+
self::VERSION_PHP82,
38+
self::VERSION_PHP83,
3039
];
3140

3241
public function __construct(private float $phpVersion)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "test/test-api-client",
3+
"description": "Client library for Swagger Petstore",
4+
"keywords": [
5+
"api-client"
6+
],
7+
"config": {
8+
"sort-packages": true
9+
},
10+
"require": {
11+
"php": "^8.1",
12+
"docler-labs/api-client-exception": "^1.0 || ^2.0",
13+
"ext-json": "*",
14+
"guzzlehttp/psr7": "^1.6 || ^2.6",
15+
"pimple/pimple": "^3.5",
16+
"psr/container": "^1.0 || ^2.0",
17+
"psr/http-client": "^1.0"
18+
},
19+
"autoload": {
20+
"psr-4": {
21+
"Test\\": "src/"
22+
}
23+
},
24+
"suggest": {
25+
"guzzlehttp/guzzle": "PSR-18 provided by Guzzle 7",
26+
"php-http/guzzle6-adapter": "PSR-18 wrapper for Guzzle 6"
27+
}
28+
}

test/suite/functional/Meta/ComposerJsonTemplateTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ public function exampleProvider(): array
3737
'composer.json',
3838
ConfigurationBuilder::fake()->withPhpVersion(PhpVersion::VERSION_PHP80)->build(),
3939
],
40+
'Default composer.json + PHP 8.1' => [
41+
'/ComposerJson/petstore.yaml',
42+
'/ComposerJson/composer_default81.json',
43+
'composer.json',
44+
ConfigurationBuilder::fake()->withPhpVersion(PhpVersion::VERSION_PHP81)->build(),
45+
],
4046
'composer.json with intl + PHP 7.4' => [
4147
'/ComposerJson/petstore_with_intl_requirement.yaml',
4248
'/ComposerJson/composer_with_intl_requirement74.json',

test/suite/unit/Output/Php/PhpVersionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class PhpVersionTest extends TestCase
1616
public function testInvalidVersion()
1717
{
1818
$this->expectException(UnexpectedValueException::class);
19-
new PhpVersion(8.3);
19+
new PhpVersion(8.4);
2020
}
2121

2222
public function testIsParameterTypeHintSupported()

0 commit comments

Comments
 (0)