Skip to content

Commit a4072c5

Browse files
authored
[PHP] Bring PSR-18 composer.json inline with main (#20897)
* [PHP] PSR-18 composer.json to use composerPackageName * Bring PSR-18 composer.json inline with main
1 parent 20db1e1 commit a4072c5

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

modules/openapi-generator/src/main/resources/php/libraries/psr-18/composer.mustache

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
2-
"name": "{{gitUserId}}/{{gitRepoId}}",
2+
{{#composerPackageName}}
3+
"name": "{{{.}}}",
4+
{{/composerPackageName}}
35
{{#artifactVersion}}
4-
"version": "{{artifactVersion}}",
6+
"version": "{{{.}}}",
57
{{/artifactVersion}}
68
"description": "{{{appDescription}}}",
79
"keywords": [
@@ -13,19 +15,19 @@
1315
"rest",
1416
"api"
1517
],
16-
"homepage": "https://openapi-generator.tech",
17-
"license": "unlicense",
18+
"homepage": "{{{artifactUrl}}}",
19+
"license": "{{{licenseName}}}",
1820
"authors": [
1921
{
20-
"name": "OpenAPI-Generator contributors",
21-
"homepage": "https://openapi-generator.tech"
22+
"name": "{{{developerOrganization}}}",
23+
"homepage": "{{{developerOrganizationUrl}}}"
2224
}
2325
],
2426
"config": {
2527
"sort-packages": true
2628
},
2729
"require": {
28-
"php": ">=7.2",
30+
"php": "^7.4 || ^8.0",
2931
"ext-curl": "*",
3032
"ext-json": "*",
3133
"ext-mbstring": "*",
@@ -41,14 +43,14 @@
4143
},
4244
"require-dev": {
4345
"phpunit/phpunit": "^8.0 || ^9.0",
44-
"friendsofphp/php-cs-fixer": "^2.12",
46+
"friendsofphp/php-cs-fixer": "^3.5",
4547
"guzzlehttp/guzzle": "^7.0",
4648
"php-http/guzzle7-adapter": "^1.0"
4749
},
4850
"autoload": {
49-
"psr-4": { "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/" }
51+
"psr-4": { "{{{escapedInvokerPackage}}}\\" : "{{{srcBasePath}}}/" }
5052
},
5153
"autoload-dev": {
52-
"psr-4": { "{{escapedInvokerPackage}}\\Test\\" : "{{testBasePath}}/" }
54+
"psr-4": { "{{{escapedInvokerPackage}}}\\Test\\" : "{{{testBasePath}}}/" }
5355
}
5456
}

samples/client/petstore/php/psr-18/composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"name": "GIT_USER_ID/GIT_REPO_ID",
32
"description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\",
43
"keywords": [
54
"openapitools",
@@ -14,15 +13,15 @@
1413
"license": "unlicense",
1514
"authors": [
1615
{
17-
"name": "OpenAPI-Generator contributors",
16+
"name": "OpenAPI",
1817
"homepage": "https://openapi-generator.tech"
1918
}
2019
],
2120
"config": {
2221
"sort-packages": true
2322
},
2423
"require": {
25-
"php": ">=7.2",
24+
"php": "^7.4 || ^8.0",
2625
"ext-curl": "*",
2726
"ext-json": "*",
2827
"ext-mbstring": "*",
@@ -38,7 +37,7 @@
3837
},
3938
"require-dev": {
4039
"phpunit/phpunit": "^8.0 || ^9.0",
41-
"friendsofphp/php-cs-fixer": "^2.12",
40+
"friendsofphp/php-cs-fixer": "^3.5",
4241
"guzzlehttp/guzzle": "^7.0",
4342
"php-http/guzzle7-adapter": "^1.0"
4443
},

0 commit comments

Comments
 (0)