File tree Expand file tree Collapse file tree 6 files changed +192
-101
lines changed
Expand file tree Collapse file tree 6 files changed +192
-101
lines changed Original file line number Diff line number Diff line change 1919 composer-deps : lowest
2020 - php-version : " 7.4"
2121 composer-deps : latest
22- - php-version : " 8.0"
23- composer-deps : lowest
2422 - php-version : " 8.0"
2523 composer-deps : latest
26- - php-version : " 8.1"
27- composer-deps : lowest
2824 - php-version : " 8.1"
2925 composer-deps : latest
3026 steps :
@@ -52,10 +48,10 @@ jobs:
5248 restore-keys : " php-${{ matrix.php-version }}-composer-${{ matrix.composer-deps }}"
5349
5450 - name : " Install dependencies"
55- run : " composer install --no-interaction --no-progress --no-suggest -- ignore-platform-reqs"
51+ run : " composer install --no-interaction --no-progress --ignore-platform-reqs"
5652
5753 - name : " Update dependencies (lowest)"
58- run : " composer update --no-interaction --no-progress --no-suggest -- prefer-lowest --prefer-stable"
54+ run : " composer update --no-interaction --no-progress --prefer-lowest --prefer-stable"
5955 if : ${{ matrix.composer-deps == 'lowest' }}
6056
6157 - name : " Update dependencies (latest)"
Original file line number Diff line number Diff line change 1515 ],
1616 "require" : {
1717 "php" : " ^7.4 || ~8.0.0 || ~8.1.0" ,
18- "cebe/php-openapi" : " ^1.5.2 " ,
19- "symfony/console" : " ^v5 .1.9"
18+ "cebe/php-openapi" : " ^1.7.0 " ,
19+ "symfony/console" : " ^5 .1.9 || ^6.0 "
2020 },
2121 "require-dev" : {
2222 "doctrine/coding-standard" : " ^9.0.0" ,
5959 "infection" : " infection --threads=4 --coverage=build/coverage"
6060 },
6161 "config" : {
62- "sort-packages" : true
62+ "sort-packages" : true ,
63+ "allow-plugins" : {
64+ "dealerdirect/phpcodesniffer-composer-installer" : true ,
65+ "infection/extension-installer" : true ,
66+ "ocramius/package-versions" : true
67+ }
6368 },
6469 "bin" : [
6570 " bin/openapi-merge"
Original file line number Diff line number Diff line change 1- FROM php:7.4 -cli-alpine
1+ FROM php:8.0 -cli-alpine
22
33RUN php --version
44
Original file line number Diff line number Diff line change 99use function implode ;
1010use function shell_exec ;
1111use function sprintf ;
12+ use function version_compare ;
13+
14+ use const PHP_VERSION ;
1215
1316/**
1417 * @coversNothing
@@ -28,97 +31,12 @@ public function testApplicationRuns(): void
2831 ])
2932 ));
3033
31- self ::assertSame (
32- <<<'EXPECTED_YAML'
33- openapi: 3.0.2
34- info:
35- title: 'Example OpenAPI Definition'
36- description: 'This is the example Description'
37- contact:
38- name: 'Base Author'
39- url: base.example.org
40- email: base-file@example.org
41- license:
42- name: MIT
43- url: 'https://tldrlegal.com/license/mit-license'
44- version: '1.0'
45- servers:
46- -
47- url: 'https://api.base.example.org'
48- description: 'Main Base URL'
49- paths:
50- /ping:
51- get:
52- tags:
53- - 'Base Route'
54- summary: 'Your GET endpoint'
55- description: 'Description of Ping'
56- operationId: get-ping
57- parameters:
58- -
59- name: responseWith
60- in: query
61- description: 'response with this message'
62- schema:
63- maxLength: 20
64- minLength: 0
65- type: string
66- responses:
67- '200':
68- description: OK
69- content:
70- application/json:
71- schema:
72- required:
73- - response
74- type: object
75- properties:
76- response:
77- type: string
78- '400':
79- description: 'Bad Request'
80- content:
81- application/problem+json:
82- schema:
83- title: ProblemResponse
84- required:
85- - type
86- - title
87- type: object
88- properties:
89- type:
90- type: string
91- description: 'type of the problem'
92- example: ValidationError
93- title:
94- type: string
95- example: 'Your request parameters didn''t validate.'
96- description: 'Default Problem Response'
97- post:
98- summary: 'Your POST endpoint'
99- description: 'Description of post Ping'
100- operationId: post-ping
101- responses:
102- '200':
103- description: OK
104- content:
105- application/json:
106- schema:
107- required:
108- - response
109- type: object
110- properties:
111- response:
112- type: string
113- components:
114- schemas: []
115- security: []
116- tags:
117- -
118- name: Base
34+ self ::assertNotNull ($ output );
11935
120- EXPECTED_YAML,
121- $ output
122- );
36+ if (version_compare (PHP_VERSION , '8.1.0 ' , '>= ' )) {
37+ self ::assertStringEqualsFile (__DIR__ . '/Fixtures/expected_php81.yml ' , $ output );
38+ } else {
39+ self ::assertStringEqualsFile (__DIR__ . '/Fixtures/expected_php80.yml ' , $ output );
40+ }
12341 }
12442}
Original file line number Diff line number Diff line change 1+ openapi : 3.0.2
2+ info :
3+ title : ' Example OpenAPI Definition'
4+ description : ' This is the example Description'
5+ contact :
6+ name : ' Base Author'
7+ url : base.example.org
8+ email : base-file@example.org
9+ license :
10+ name : MIT
11+ url : ' https://tldrlegal.com/license/mit-license'
12+ version : ' 1.0'
13+ servers :
14+ -
15+ url : ' https://api.base.example.org'
16+ description : ' Main Base URL'
17+ paths :
18+ /ping :
19+ get :
20+ tags :
21+ - ' Base Route'
22+ summary : ' Your GET endpoint'
23+ description : ' Description of Ping'
24+ operationId : get-ping
25+ parameters :
26+ -
27+ name : responseWith
28+ in : query
29+ description : ' response with this message'
30+ schema :
31+ maxLength : 20
32+ minLength : 0
33+ type : string
34+ responses :
35+ ' 200 ' :
36+ description : OK
37+ content :
38+ application/json :
39+ schema :
40+ required :
41+ - response
42+ type : object
43+ properties :
44+ response :
45+ type : string
46+ ' 400 ' :
47+ description : ' Bad Request'
48+ content :
49+ application/problem+json :
50+ schema :
51+ title : ProblemResponse
52+ required :
53+ - type
54+ - title
55+ type : object
56+ properties :
57+ type :
58+ type : string
59+ description : ' type of the problem'
60+ example : ValidationError
61+ title :
62+ type : string
63+ example : ' Your request parameters didn'' t validate.'
64+ description : ' Default Problem Response'
65+ post :
66+ summary : ' Your POST endpoint'
67+ description : ' Description of post Ping'
68+ operationId : post-ping
69+ responses :
70+ ' 200 ' :
71+ description : OK
72+ content :
73+ application/json :
74+ schema :
75+ required :
76+ - response
77+ type : object
78+ properties :
79+ response :
80+ type : string
81+ components :
82+ schemas : { }
83+ security : []
84+ tags :
85+ -
86+ name : Base
Original file line number Diff line number Diff line change 1+ openapi : 3.0.2
2+ info :
3+ title : ' Example OpenAPI Definition'
4+ description : ' This is the example Description'
5+ contact :
6+ name : ' Base Author'
7+ url : base.example.org
8+ email : base-file@example.org
9+ license :
10+ name : MIT
11+ url : ' https://tldrlegal.com/license/mit-license'
12+ version : ' 1.0'
13+ servers :
14+ -
15+ url : ' https://api.base.example.org'
16+ description : ' Main Base URL'
17+ paths :
18+ /ping :
19+ get :
20+ tags :
21+ - ' Base Route'
22+ summary : ' Your GET endpoint'
23+ description : ' Description of Ping'
24+ operationId : get-ping
25+ parameters :
26+ -
27+ name : responseWith
28+ in : query
29+ description : ' response with this message'
30+ schema :
31+ maxLength : 20
32+ minLength : 0
33+ type : string
34+ responses :
35+ ' 200 ' :
36+ description : OK
37+ content :
38+ application/json :
39+ schema :
40+ required :
41+ - response
42+ type : object
43+ properties :
44+ response :
45+ type : string
46+ ' 400 ' :
47+ description : ' Bad Request'
48+ content :
49+ application/problem+json :
50+ schema :
51+ title : ProblemResponse
52+ required :
53+ - type
54+ - title
55+ type : object
56+ properties :
57+ type :
58+ type : string
59+ description : ' type of the problem'
60+ example : ValidationError
61+ title :
62+ type : string
63+ example : " Your request parameters didn't validate."
64+ description : ' Default Problem Response'
65+ post :
66+ summary : ' Your POST endpoint'
67+ description : ' Description of post Ping'
68+ operationId : post-ping
69+ responses :
70+ ' 200 ' :
71+ description : OK
72+ content :
73+ application/json :
74+ schema :
75+ required :
76+ - response
77+ type : object
78+ properties :
79+ response :
80+ type : string
81+ components :
82+ schemas : { }
83+ security : []
84+ tags :
85+ -
86+ name : Base
You can’t perform that action at this time.
0 commit comments