Skip to content

Commit 32efc1b

Browse files
committed
Updated to latest CS tooling
1 parent 0ce7667 commit 32efc1b

File tree

5 files changed

+94
-259
lines changed

5 files changed

+94
-259
lines changed

.php_cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php declare(strict_types=1);
2+
3+
use ApiClients\Tools\TestUtilities\PhpCsFixerConfig;
4+
5+
return (function ()
6+
{
7+
$paths = [
8+
__DIR__ . DIRECTORY_SEPARATOR . 'src',
9+
__DIR__ . DIRECTORY_SEPARATOR . 'tests',
10+
];
11+
12+
return PhpCsFixerConfig::create()
13+
->setFinder(
14+
PhpCsFixer\Finder::create()
15+
->in($paths)
16+
->append($paths)
17+
)
18+
->setUsingCache(false)
19+
;
20+
})();

.travis.yml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,51 @@ cache:
55
directories:
66
- $HOME/.composer/cache/files
77

8-
## PHP versions we test against
9-
php:
10-
- 7.0
11-
- 7.1
12-
- nightly
13-
14-
## Environment variables
15-
env:
16-
- coverage=true
17-
188
## Build matrix for lowest and highest possible targets
199
matrix:
2010
include:
11+
- php: 7.0
12+
env:
13+
- qaExtended=true
14+
- php: 7.1
15+
- php: nightly
16+
env:
17+
- dropPlatform=false
2118
- php: 7.0
2219
env:
2320
- dependencies=lowest
24-
- coverage=false
2521
- php: 7.1
2622
env:
2723
- dependencies=lowest
28-
- coverage=false
2924
- php: nightly
3025
env:
3126
- dependencies=lowest
32-
- coverage=false
27+
- dropPlatform=false
3328
- php: 7.0
3429
env:
3530
- dependencies=highest
36-
- coverage=false
3731
- php: 7.1
3832
env:
3933
- dependencies=highest
40-
- coverage=false
4134
- php: nightly
4235
env:
4336
- dependencies=highest
44-
- coverage=false
37+
- dropPlatform=false
4538

4639
## Install or update dependencies
4740
install:
4841
- composer validate
49-
- if [ "$coverage" = "false" ]; then phpenv config-rm xdebug.ini || :; fi;
42+
- if [ -z "$dropPlatform" ]; then composer config --unset platform.php; fi;
43+
- if [ -z "$qaExtended" ]; then phpenv config-rm xdebug.ini || :; fi;
5044
- if [ -z "$dependencies" ]; then composer install --prefer-dist; fi;
5145
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-dist -n; fi;
5246
- if [ "$dependencies" = "highest" ]; then composer update --prefer-dist -n; fi;
5347
- composer show
5448

5549
## Run the actual test
5650
script:
57-
- if [ "$coverage" = "false" ]; then make ci; fi;
58-
- if [ "$coverage" = "true" ]; then make ci-with-coverage; fi;
51+
- if [ -z "$qaExtended" ]; then make ci; fi;
52+
- if [ "$qaExtended" = "true" ]; then make ci-extended; fi;
5953

6054
## Gather coverage and set it to coverage servers
61-
after_script: make ci-coverage
55+
after_script: if [ "$qaExtended" = "true" ]; then make ci-coverage; fi;

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ all-coverage:
77
ci:
88
composer run-script qa-ci --timeout=0
99

10-
ci-with-coverage:
11-
composer run-script qa-ci-coverage --timeout=0
10+
ci-extended:
11+
composer run-script qa-ci-extended --timeout=0
1212

1313
contrib:
1414
composer run-script qa-contrib --timeout=0
@@ -19,6 +19,9 @@ init:
1919
cs:
2020
composer cs
2121

22+
cs-fix:
23+
composer cs-fix
24+
2225
unit:
2326
composer run-script unit --timeout=0
2427

composer.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"api-clients/middleware-delay": "^2.0",
3131
"api-clients/middleware-pool": "^2.0",
3232
"api-clients/resource-generator": "dev-master",
33-
"api-clients/test-utilities": "^3.0.1"
33+
"api-clients/test-utilities": "^4.1"
3434
},
3535
"suggest": {
3636
"api-clients/middleware-delay": "Add a delay between requests to not hammer Travis",
@@ -47,7 +47,10 @@
4747
}
4848
},
4949
"config": {
50-
"sort-packages": true
50+
"sort-packages": true,
51+
"platform": {
52+
"php": "7.0"
53+
}
5154
},
5255
"extra": {
5356
"api-clients": {
@@ -61,7 +64,11 @@
6164
"ensure-installed": "composer install --ansi -n -q",
6265
"cs": [
6366
"@ensure-installed",
64-
"phpcs --standard=PSR2 src/"
67+
"php-cs-fixer fix --config=.php_cs --ansi --dry-run --diff --verbose --allow-risky=yes --show-progress=estimating"
68+
],
69+
"cs-fix": [
70+
"@ensure-installed",
71+
"php-cs-fixer fix --config=.php_cs --ansi --verbose --allow-risky=yes --show-progress=estimating"
6572
],
6673
"unit": [
6774
"@ensure-installed",
@@ -91,9 +98,9 @@
9198
"@unit"
9299
],
93100
"qa-ci": [
94-
"@qa-all"
101+
"@unit"
95102
],
96-
"qa-ci-coverage": [
103+
"qa-ci-extended": [
97104
"@qa-all-coverage"
98105
],
99106
"qa-ci-windows": [

0 commit comments

Comments
 (0)