Skip to content

Commit e282a05

Browse files
authored
[php-slim4] Set required PHP version to 7.2 (#6530)
* Bump required PHP version to 7.2 * Update rest dependencies to meet php 7.2 Latest phpunit 9 requires PHP 7.3, so I've set phpunit 8 as a fallback. * Fix TestCase inheritance * Add phpunit cache file to gitignore * Put license @PHPDoc into separate mustache * Bump readme PHP version to 7.2 * Bump @PHPDoc PHP version to 7.2 * Update Zend Diactoros with suggested package * Refresh samples * Remove broken tests These tests will be fixed in next PR which moves Mock feature to external repo. * Point root Travis CI environment to PHP 7.3
1 parent 90f904a commit e282a05

File tree

153 files changed

+983
-1531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+983
-1531
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ before_install:
8585
#- sudo apt-get update
8686
#- sudo apt-get install dart
8787
# switch to php7
88-
- phpenv global 7.1
88+
- phpenv global 7.3
8989
- php -v
9090
# install perl module
9191
#- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)

modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ This server has been generated with [Nyholm PSR-7](https://github.com/Nyholm/psr
1313
This server has been generated with [Guzzle PSR-7](https://github.com/guzzle/psr7) implementation and [Guzzle HTTP Factory](https://github.com/http-interop/http-factory-guzzle).
1414
{{/isGuzzlePsr7}}
1515
{{#isZendDiactoros}}
16-
This server has been generated with [Zend Diactoros](https://github.com/zendframework/zend-diactoros).
16+
This server has been generated with [Laminas (Zend) PSR-7 implementation](https://github.com/laminas/laminas-diactoros).
1717
{{/isZendDiactoros}}
1818

1919
## Requirements
2020

2121
* Web server with URL rewriting
22-
* PHP 7.1 or newer
22+
* PHP 7.2 or newer
2323

2424
This package contains `.htaccess` for Apache configuration.
2525
If you use another server(Nginx, HHVM, IIS, lighttpd) check out [Web Servers](https://www.slimframework.com/docs/v3/start/web-servers.html) doc.

modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,12 @@
11
<?php
22

3-
/**
4-
* SlimRouter
5-
*
6-
* PHP version 7.1
7-
*
8-
* @package {{invokerPackage}}
9-
* @author OpenAPI Generator team
10-
* @link https://github.com/openapitools/openapi-generator
11-
*/
12-
13-
/**{{#apiInfo}}{{#appName}}
14-
* {{{appName}}}
15-
*
16-
{{/appName}}
17-
{{#appDescription}}
18-
* {{{appDescription}}}
19-
{{/appDescription}}
20-
{{#version}}
21-
* The version of the OpenAPI document: {{{version}}}
22-
{{/version}}
23-
{{#infoEmail}}
24-
* Contact: {{{infoEmail}}}
25-
{{/infoEmail}}
26-
* Generated by: https://github.com/openapitools/openapi-generator.git
27-
*/
3+
{{>licenseInfo}}
284

295
/**
306
* NOTE: This class is auto generated by the openapi generator program.
317
* https://github.com/openapitools/openapi-generator
328
* Do not edit the class manually.
33-
*/
9+
*/{{#apiInfo}}
3410
namespace {{invokerPackage}};
3511

3612
use Slim\Factory\AppFactory;

modules/openapi-generator/src/main/resources/php-slim4-server/abstract_authenticator.mustache

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,12 @@
11
<?php
22

3-
/**
4-
* {{abstractNamePrefix}}Authenticator{{abstractNameSuffix}}
5-
*
6-
* PHP version 7.1
7-
*
8-
* @package {{invokerPackage}}
9-
* @author OpenAPI Generator team
10-
* @link https://github.com/openapitools/openapi-generator
11-
*/
12-
13-
/**{{#apiInfo}}{{#appName}}
14-
* {{{appName}}}
15-
*
16-
{{/appName}}
17-
{{#appDescription}}
18-
* {{{appDescription}}}
19-
{{/appDescription}}
20-
{{#version}}
21-
* The version of the OpenAPI document: {{{version}}}
22-
{{/version}}
23-
{{#infoEmail}}
24-
* Contact: {{{infoEmail}}}
25-
{{/infoEmail}}
26-
* Generated by: https://github.com/openapitools/openapi-generator.git
27-
*/
3+
{{>licenseInfo}}
284

295
/**
306
* NOTE: This class is auto generated by the openapi generator program.
317
* https://github.com/openapitools/openapi-generator
328
* Do not edit the class manually.
33-
*/
9+
*/{{#apiInfo}}
3410
namespace {{authPackage}};
3511

3612
use Psr\Container\ContainerInterface;

modules/openapi-generator/src/main/resources/php-slim4-server/api.mustache

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,6 @@
11
<?php
22

3-
/**
4-
* {{classname}}
5-
*
6-
* PHP version 7.1
7-
*
8-
* @package {{apiPackage}}
9-
* @author OpenAPI Generator team
10-
* @link https://github.com/openapitools/openapi-generator
11-
*/
12-
13-
/**
14-
{{#appName}}
15-
* {{{appName}}}
16-
*
17-
{{/appName}}
18-
{{#appDescription}}
19-
* {{{appDescription}}}
20-
{{/appDescription}}
21-
{{#version}}
22-
* The version of the OpenAPI document: {{{version}}}
23-
{{/version}}
24-
{{#infoEmail}}
25-
* Contact: {{{infoEmail}}}
26-
{{/infoEmail}}
27-
* Generated by: https://github.com/openapitools/openapi-generator.git
28-
*/
3+
{{>licenseInfo}}
294

305
/**
316
* NOTE: This class is auto generated by the openapi generator program.

modules/openapi-generator/src/main/resources/php-slim4-server/api_test.mustache

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,12 @@
11
<?php
22

3-
{{#operations}}/**
4-
* {{userClassname}}Test
5-
*
6-
* PHP version 7.1
7-
*
8-
* @package {{apiPackage}}
9-
* @author OpenAPI Generator team
10-
* @link https://github.com/openapitools/openapi-generator
11-
*/
12-
13-
/**
14-
{{#appName}}
15-
* {{{appName}}}
16-
*
17-
{{/appName}}
18-
{{#appDescription}}
19-
* {{{appDescription}}}
20-
{{/appDescription}}
21-
{{#version}}
22-
* The version of the OpenAPI document: {{{version}}}
23-
{{/version}}
24-
{{#infoEmail}}
25-
* Contact: {{{infoEmail}}}
26-
{{/infoEmail}}
27-
* Generated by: https://github.com/openapitools/openapi-generator.git
28-
*/
3+
{{>licenseInfo}}
294

305
/**
316
* NOTE: This class is auto generated by the openapi generator program.
327
* https://github.com/openapitools/openapi-generator
338
* Please update the test case below to test the endpoint.
34-
*/
9+
*/{{#operations}}
3510
namespace {{apiPackage}};
3611

3712
use PHPUnit\Framework\TestCase;
@@ -52,28 +27,28 @@ class {{userClassname}}Test extends TestCase
5227
/**
5328
* Setup before running any test cases
5429
*/
55-
public static function setUpBeforeClass()
30+
public static function setUpBeforeClass(): void
5631
{
5732
}
5833

5934
/**
6035
* Setup before running each test case
6136
*/
62-
public function setUp()
37+
public function setUp(): void
6338
{
6439
}
6540

6641
/**
6742
* Clean up after running each test case
6843
*/
69-
public function tearDown()
44+
public function tearDown(): void
7045
{
7146
}
7247

7348
/**
7449
* Clean up after running all test cases
7550
*/
76-
public static function tearDownAfterClass()
51+
public static function tearDownAfterClass(): void
7752
{
7853
}
7954
{{#operation}}

modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88
}
99
],
1010
"require": {
11-
"php": "^7.1",
12-
"slim/slim": "^4.0",
11+
"php": "^7.2",
12+
"slim/slim": "^4.5.0",
1313
"dyorg/slim-token-authentication": "dev-slim4",
1414
{{#isSlimPsr7}}
15-
"slim/psr7": "^0.4.0"
15+
"slim/psr7": "^1.1.0"
1616
{{/isSlimPsr7}}
1717
{{#isNyholmPsr7}}
18-
"nyholm/psr7": "^1.1.0",
19-
"nyholm/psr7-server": "^0.3.0"
18+
"nyholm/psr7": "^1.3.0",
19+
"nyholm/psr7-server": "^0.4.1"
2020
{{/isNyholmPsr7}}
2121
{{#isGuzzlePsr7}}
2222
"guzzlehttp/psr7": "^1.6.1",
2323
"http-interop/http-factory-guzzle": "^1.0.0"
2424
{{/isGuzzlePsr7}}
2525
{{#isZendDiactoros}}
26-
"zendframework/zend-diactoros": "^2.1.3"
26+
"laminas/laminas-diactoros": "^2.3.0"
2727
{{/isZendDiactoros}}
2828
},
2929
"require-dev": {
30-
"phpunit/phpunit": "^6.0 || ^7.0",
31-
"overtrue/phplint": "^1.0",
30+
"phpunit/phpunit": "^8.0 || ^9.0",
31+
"overtrue/phplint": "^2.0.2",
3232
"squizlabs/php_codesniffer": "^3.5"
3333
},
3434
"autoload": {
@@ -46,8 +46,6 @@
4646
],
4747
"test-apis": "phpunit --testsuite Apis",
4848
"test-models": "phpunit --testsuite Models",
49-
"test-mock": "phpunit --testsuite Mock",
50-
"test-utils": "phpunit --testsuite Utils",
5149
"phpcs": "phpcs",
5250
"phplint": "phplint ./ --exclude=vendor"
5351
}

modules/openapi-generator/src/main/resources/php-slim4-server/gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ composer.lock
1212

1313
# Do not commit local PHPUnit config
1414
/phpunit.xml
15+
/.phpunit.result.cache
1516

1617
# Do not commit local PHP_CodeSniffer config
1718
/phpcs.xml

modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
<?php
22

3-
{{#apiInfo}}/**
4-
* {{appName}}
5-
*
6-
* PHP version 7.1
7-
*
8-
* @package {{apiPackage}}
9-
* @author OpenAPI Generator team
10-
* @version {{appVersion}}
11-
* @link https://github.com/openapitools/openapi-generator
12-
*/
3+
{{>licenseInfo}}
4+
5+
/**
6+
* NOTE: This class is auto generated by the openapi generator program.
7+
* https://github.com/openapitools/openapi-generator
8+
*/{{#apiInfo}}
139

1410
require_once __DIR__ . '/vendor/autoload.php';
1511

modules/openapi-generator/src/main/resources/php-slim4-server/json_body_parser_middleware.mustache

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,12 @@
11
<?php
22

3-
/**
4-
* JsonBodyParserMiddleware
5-
*
6-
* PHP version 7.1
7-
*
8-
* @package {{invokerPackage}}
9-
* @author OpenAPI Generator team
10-
* @link https://github.com/openapitools/openapi-generator
11-
*/
12-
13-
/**{{#apiInfo}}{{#appName}}
14-
* {{{appName}}}
15-
*
16-
{{/appName}}
17-
{{#appDescription}}
18-
* {{{appDescription}}}
19-
{{/appDescription}}
20-
{{#version}}
21-
* The version of the OpenAPI document: {{{version}}}
22-
{{/version}}
23-
{{#infoEmail}}
24-
* Contact: {{{infoEmail}}}
25-
{{/infoEmail}}
26-
* Generated by: https://github.com/openapitools/openapi-generator.git
27-
*/
3+
{{>licenseInfo}}
284

295
/**
306
* NOTE: This class is auto generated by the openapi generator program.
317
* https://github.com/openapitools/openapi-generator
328
* Do not edit the class manually.
33-
*/
9+
*/{{#apiInfo}}
3410
namespace {{invokerPackage}}\Middleware;
3511

3612
use Psr\Http\Message\ResponseInterface;

0 commit comments

Comments
 (0)