-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[php-symfony] Set required PHP version ^7.1.3 (#6181)
* Set PHP 7.1.3 required version I've tried to specify ^7.0 version at first, but main package which is symfony/framework-bundle@v4.4.8 requires PHP ^7.1.3. * Bump Symfony FrameworkBundle to ^4.4.8 Current Symfony Framework stable version is v5.0.8, but I guess it requires significant codebase upgrade, so I've sticked with 4.4.8 which shouldn't cause any breaking changes. Old requirement was ^3.3|^4.1 which compatible with 4.4.8. * Bump PHPUnit version to ^7.0 PHPUnit 8.x version required PHP ^7.2, so I'm setting 7.x version to support PHP 7.1. There is new way to specify Kernel class, related PR: symfony/symfony#22668 * Bump PHP CS Fixer version to ^2.16.3 Configuration and all renamed rules fixed. Config file renamed to .php_cs.dist as recommended in migration guide. Migration guide from 1.x to 2.x: https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/UPGRADE.md#config-file * Remove PHP_CodeSniffer package Second linter doesn't make sense. I think Symfony user would prefer PHP CS Fixer over PHP_CodeSniffer because first one maintained by Symfony members. * Remove satooshi/php-coveralls package from Composer This package is abandoned and Coveralls recommends to install it directly in Travis-CI task script. * Update Travic-CI config I've changed test versions to PHP 7.1.3 and 7.2. PHPUnit generates coverage report in report/logs/clover.xml file. Then PHP CS Fixer runs with --dry-run option to not override anything just to show coding style errors. * Add basic Coveralls config This is basic recommended config for a PHP based project. * Add symfony/yaml package This package was part of satooshi/php-coveralls, now it should be defined as dev dependency. * Do not commit composer.lock I think committed composer.lock can cause CI errors while tests on fresh installs are better. * Remove confusing Ruby comment
- Loading branch information
Showing
57 changed files
with
201 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
modules/openapi-generator/src/main/resources/php-symfony/.coveralls.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
service_name: travis-ci # travis-ci or travis-pro | ||
|
||
# for php-coveralls | ||
coverage_clover: report/logs/clover.xml | ||
json_path: report/logs/coveralls-upload.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
modules/openapi-generator/src/main/resources/php-symfony/.php_cs
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
modules/openapi-generator/src/main/resources/php-symfony/.php_cs.dist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setUsingCache(true) | ||
->setRules([ | ||
'@PSR2' => true, | ||
'ordered_imports' => [ | ||
'sort_algorithm' => 'alpha' | ||
], | ||
'phpdoc_order' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'strict_comparison' => true, | ||
'strict_param' => true | ||
]) | ||
->setFinder($finder) | ||
; |
26 changes: 18 additions & 8 deletions
26
modules/openapi-generator/src/main/resources/php-symfony/.travis.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
language: php | ||
sudo: false | ||
dist: trusty | ||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- hhvm | ||
before_install: "composer install" | ||
script: "vendor/bin/phpunit" | ||
- 7.1.3 | ||
- 7.2 | ||
|
||
install: | ||
- composer install --dev --no-interaction | ||
script: | ||
- mkdir -p report/logs | ||
- php vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=report/logs/clover.xml | ||
- php vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run --stop-on-violation --using-cache=no | ||
|
||
before_script: | ||
- composer require --dev php-coveralls/php-coveralls --no-interaction | ||
|
||
after_success: | ||
- travis_retry php vendor/bin/php-coveralls | ||
# or enable logging | ||
- travis_retry php vendor/bin/php-coveralls -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/** | ||
* ApiServer | ||
* | ||
* PHP version 5 | ||
* PHP version 7.1.3 | ||
* | ||
* @category Class | ||
* @package {{apiPackage}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
modules/openapi-generator/src/main/resources/php-symfony/api.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
/** | ||
* {{classname}} | ||
* PHP version 5 | ||
* PHP version 7.1.3 | ||
* | ||
* @category Class | ||
* @package {{invokerPackage}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
modules/openapi-generator/src/main/resources/php-symfony/testing/ControllerTest.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
modules/openapi-generator/src/main/resources/php-symfony/testing/api_test.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
samples/server/petstore/php-symfony/SymfonyBundle-php/.coveralls.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
service_name: travis-ci # travis-ci or travis-pro | ||
|
||
# for php-coveralls | ||
coverage_clover: report/logs/clover.xml | ||
json_path: report/logs/coveralls-upload.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
samples/server/petstore/php-symfony/SymfonyBundle-php/.php_cs
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
samples/server/petstore/php-symfony/SymfonyBundle-php/.php_cs.dist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setUsingCache(true) | ||
->setRules([ | ||
'@PSR2' => true, | ||
'ordered_imports' => [ | ||
'sort_algorithm' => 'alpha' | ||
], | ||
'phpdoc_order' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'strict_comparison' => true, | ||
'strict_param' => true | ||
]) | ||
->setFinder($finder) | ||
; |
Oops, something went wrong.