Skip to content

Commit b9bc374

Browse files
committed
Bumped to PHP 7.2 and applied new CS rules
1 parent ff847a2 commit b9bc374

File tree

11 files changed

+1601
-798
lines changed

11 files changed

+1601
-798
lines changed

.php_cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php declare(strict_types=1);
22

3-
use ApiClients\Tools\TestUtilities\PhpCsFixerConfig;
3+
use ApiClients\Tools\CsFixerConfig\PhpCsFixerConfig;
44
use PhpCsFixer\Config;
55

66
return (function (): Config
77
{
88
$paths = [
9+
__DIR__ . DIRECTORY_SEPARATOR . 'examples',
910
__DIR__ . DIRECTORY_SEPARATOR . 'src',
1011
__DIR__ . DIRECTORY_SEPARATOR . 'tests',
11-
__DIR__ . DIRECTORY_SEPARATOR . 'examples',
1212
];
1313

1414
return PhpCsFixerConfig::create()

.travis.yml

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,62 @@
11
language: php
2-
sudo: false
32

43
## Cache composer bits
54
cache:
65
directories:
76
- $HOME/.composer/cache/files
87

9-
## PHP versions we test against
10-
php:
11-
- 7.0
12-
- 7.1
13-
- nightly
14-
158
## Build matrix for lowest and highest possible targets
169
matrix:
1710
include:
18-
- php: 7.0
19-
env: dependencies=lowest
20-
- php: 7.1
21-
env: dependencies=lowest
11+
- php: 7.2
12+
env:
13+
- qaExtended=true
14+
- dropPlatform=false
15+
- php: 7.3
16+
env:
17+
- dropPlatform=false
18+
- php: nightly
19+
env:
20+
- dropPlatform=false
21+
- php: 7.2
22+
env:
23+
- dependencies=lowest
24+
- dropPlatform=false
25+
- php: 7.3
26+
env:
27+
- dependencies=lowest
28+
- dropPlatform=false
2229
- php: nightly
23-
env: dependencies=lowest
24-
- php: 7.0
25-
env: dependencies=highest
26-
- php: 7.1
27-
env: dependencies=highest
30+
env:
31+
- dependencies=lowest
32+
- dropPlatform=false
33+
- php: 7.2
34+
env:
35+
- dependencies=highest
36+
- dropPlatform=false
37+
- php: 7.3
38+
env:
39+
- dependencies=highest
40+
- dropPlatform=false
2841
- php: nightly
29-
env: dependencies=highest
42+
env:
43+
- dependencies=highest
44+
- dropPlatform=false
3045

3146
## Install or update dependencies
3247
install:
48+
- composer validate
49+
- if [ -z "$dropPlatform" ]; then composer config --unset platform.php; fi;
50+
- if [ -z "$qaExtended" ]; then phpenv config-rm xdebug.ini || :; fi;
3351
- if [ -z "$dependencies" ]; then composer install --prefer-dist; fi;
3452
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-dist -n; fi;
3553
- if [ "$dependencies" = "highest" ]; then composer update --prefer-dist -n; fi;
3654
- composer show
3755

3856
## Run the actual test
39-
script: make ci
57+
script:
58+
- if [ -z "$qaExtended" ]; then make ci; fi;
59+
- if [ "$qaExtended" = "true" ]; then make ci-extended; fi;
4060

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

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ unit-coverage:
3030

3131
ci-coverage: init
3232
composer ci-coverage
33+
34+
generate-resources: init
35+
./vendor/bin/api-client-resource-generator ./resources.yml

appveyor.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
build: false
2+
platform:
3+
- x64
4+
clone_folder: c:\projects\php-project-workspace
5+
6+
## Build matrix for lowest and highest possible targets
7+
environment:
8+
matrix:
9+
- dependencies: lowest
10+
php_ver_target: 7.2
11+
- dependencies: current
12+
php_ver_target: 7.2
13+
- dependencies: highest
14+
php_ver_target: 7.2
15+
16+
## Cache composer file
17+
cache:
18+
- '%LOCALAPPDATA%\Composer\files -> composer.lock'
19+
20+
## Set up environment varriables
21+
init:
22+
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH%
23+
- SET COMPOSER_NO_INTERACTION=1
24+
- SET PHP=1
25+
- SET ANSICON=121x90 (121x90)
26+
27+
## Install PHP and composer, and run the appropriate composer command
28+
install:
29+
- IF EXIST c:\tools\php (SET PHP=0)
30+
- ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
31+
- cd c:\tools\php
32+
- IF %PHP%==1 copy php.ini-production php.ini /Y
33+
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
34+
- IF %PHP%==1 echo extension_dir=ext >> php.ini
35+
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
36+
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
37+
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini
38+
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
39+
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
40+
- cd c:\projects\php-project-workspace
41+
- composer config --unset platform.php
42+
- IF %dependencies%==lowest appveyor-retry composer update --prefer-lowest --no-progress --profile -n
43+
- IF %dependencies%==current appveyor-retry composer install --no-progress --profile
44+
- IF %dependencies%==highest appveyor-retry composer update --no-progress --profile -n
45+
#- composer show
46+
47+
## Run the actual test
48+
test_script:
49+
- cd c:\projects\php-project-workspace
50+
- vendor/bin/phpunit -c phpunit.xml.dist

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
}
99
],
1010
"require": {
11-
"php": "^7.0",
11+
"php": "^7.2",
1212
"react/promise": "^2.5",
1313
"wyrihaximus/react-child-process-closure": "^1.0"
1414
},
1515
"require-dev": {
16-
"api-clients/test-utilities": "^4.1"
16+
"api-clients/cs-fixer-config": "^1.1",
17+
"api-clients/test-utilities": "^5.2"
1718
},
1819
"autoload": {
1920
"psr-4": {
@@ -29,7 +30,7 @@
2930
"config": {
3031
"sort-packages": true,
3132
"platform": {
32-
"php": "7.0"
33+
"php": "7.2"
3334
}
3435
},
3536
"scripts": {

0 commit comments

Comments
 (0)