Skip to content

Commit 406681c

Browse files
committed
Updated to PHP 7.0
1 parent e4faaf4 commit 406681c

File tree

9 files changed

+2756
-748
lines changed

9 files changed

+2756
-748
lines changed

.dunitconfig

Lines changed: 0 additions & 14 deletions
This file was deleted.

.php_cs

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

.travis.yml

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,66 @@
11
language: php
2-
sudo: false
32

43
## Cache composer bits
54
cache:
65
directories:
7-
- $HOME/.composer/cache
8-
9-
## PHP versions we test against
10-
php:
11-
- 5.6
12-
- 7.0
13-
- hhvm
6+
- $HOME/.composer/cache/files
147

158
## Build matrix for lowest and highest possible targets
169
matrix:
1710
include:
18-
- php: 5.6
19-
env: dependencies=lowest
2011
- php: 7.0
21-
env: dependencies=lowest
22-
- php: hhvm
23-
env: dependencies=lowest
24-
- php: 5.6
25-
env: dependencies=highest
12+
env:
13+
- qaExtended=true
14+
- php: 7.1
15+
- php: 7.2
16+
env:
17+
- dropPlatform=false
18+
- php: nightly
19+
env:
20+
- dropPlatform=false
2621
- php: 7.0
27-
env: dependencies=highest
28-
- php: hhvm
29-
env: dependencies=highest
30-
allow_failures:
31-
- php: hhvm
32-
33-
## Update composer and configure authentication token
34-
before_install:
35-
- composer self-update
22+
env:
23+
- dependencies=lowest
24+
- php: 7.1
25+
env:
26+
- dependencies=lowest
27+
- php: 7.2
28+
env:
29+
- dependencies=lowest
30+
- dropPlatform=false
31+
- php: nightly
32+
env:
33+
- dependencies=lowest
34+
- dropPlatform=false
35+
- php: 7.0
36+
env:
37+
- dependencies=highest
38+
- php: 7.1
39+
env:
40+
- dependencies=highest
41+
- php: 7.2
42+
env:
43+
- dependencies=highest
44+
- dropPlatform=false
45+
- php: nightly
46+
env:
47+
- dependencies=highest
48+
- dropPlatform=false
3649

3750
## Install or update dependencies
3851
install:
52+
- composer validate
53+
- if [ -z "$dropPlatform" ]; then composer config --unset platform.php; fi;
54+
- if [ -z "$qaExtended" ]; then phpenv config-rm xdebug.ini || :; fi;
3955
- if [ -z "$dependencies" ]; then composer install --prefer-dist; fi;
4056
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-dist -n; fi;
4157
- if [ "$dependencies" = "highest" ]; then composer update --prefer-dist -n; fi;
42-
- composer show -i
58+
- composer show
4359

4460
## Run the actual test
45-
script: make travis
61+
script:
62+
- if [ -z "$qaExtended" ]; then make ci; fi;
63+
- if [ "$qaExtended" = "true" ]; then make ci-extended; fi;
4664

4765
## Gather coverage and set it to coverage servers
48-
after_script: make travis-coverage
66+
after_script: if [ "$qaExtended" = "true" ]; then make ci-coverage; fi;

Makefile

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
1-
all: cs dunit unit
2-
travis: cs travis-unit
3-
contrib: cs dunit unit
1+
all:
2+
composer run-script qa-all --timeout=0
3+
4+
all-coverage:
5+
composer run-script qa-all-coverage --timeout=0
6+
7+
ci:
8+
composer run-script qa-ci --timeout=0
9+
10+
ci-extended:
11+
composer run-script qa-ci-extended --timeout=0
12+
13+
contrib:
14+
composer run-script qa-contrib --timeout=0
415

516
init:
6-
if [ ! -d vendor ]; then composer install; fi;
17+
composer ensure-installed
718

8-
cs: init
9-
./vendor/bin/phpcs --standard=PSR2 src/
19+
cs:
20+
composer cs
1021

11-
unit: init
12-
./vendor/bin/phpunit --coverage-text --coverage-html covHtml
22+
cs-fix:
23+
composer cs-fix
1324

14-
dunit: init
15-
./vendor/bin/dunit
25+
unit:
26+
composer run-script unit --timeout=0
1627

17-
travis-unit: init
18-
./vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml
28+
unit-coverage:
29+
composer run-script unit-coverage --timeout=0
1930

20-
travis-coverage: init
21-
if [ -f ./build/logs/clover.xml ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi
31+
ci-coverage: init
32+
composer ci-coverage

appveyor.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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.0
11+
- dependencies: lowest
12+
php_ver_target: 7.1
13+
- dependencies: lowest
14+
php_ver_target: 7.2
15+
- dependencies: current
16+
php_ver_target: 7.0
17+
- dependencies: current
18+
php_ver_target: 7.1
19+
- dependencies: current
20+
php_ver_target: 7.2
21+
- dependencies: highest
22+
php_ver_target: 7.0
23+
- dependencies: highest
24+
php_ver_target: 7.1
25+
- dependencies: highest
26+
php_ver_target: 7.2
27+
28+
## Cache composer file
29+
cache:
30+
- '%LOCALAPPDATA%\Composer\files -> composer.lock'
31+
32+
## Set up environment varriables
33+
init:
34+
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH%
35+
- SET COMPOSER_NO_INTERACTION=1
36+
- SET PHP=1
37+
- SET ANSICON=121x90 (121x90)
38+
39+
## Install PHP and composer, and run the appropriate composer command
40+
install:
41+
- IF EXIST c:\tools\php (SET PHP=0)
42+
- 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|]','')
43+
- cd c:\tools\php
44+
- IF %PHP%==1 copy php.ini-production php.ini /Y
45+
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
46+
- IF %PHP%==1 echo extension_dir=ext >> php.ini
47+
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
48+
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
49+
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini
50+
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
51+
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
52+
- cd c:\projects\php-project-workspace
53+
- composer config --unset platform.php
54+
- IF %dependencies%==lowest appveyor-retry composer update --prefer-lowest --no-progress --profile -n
55+
- IF %dependencies%==current appveyor-retry composer install --no-progress --profile
56+
- IF %dependencies%==highest appveyor-retry composer update --no-progress --profile -n
57+
- composer show
58+
59+
## Run the actual test
60+
test_script:
61+
- cd c:\projects\php-project-workspace
62+
- vendor/bin/phpunit -c phpunit.xml.dist

composer.json

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
"clue/redis-react": "^2.0 || ^1.0 || ^0.5.1"
1414
},
1515
"require-dev": {
16-
"phpunit/phpunit": "^5.2.3",
17-
"squizlabs/php_codesniffer": "^2.6",
18-
"vectorface/dunit": "~2.0",
19-
"phake/phake": "^2.3",
20-
"clue/block-react": "^1.1"
16+
"api-clients/test-utilities": "^4.3"
2117
},
2218
"autoload": {
2319
"psr-4": {
@@ -28,5 +24,64 @@
2824
"psr-4": {
2925
"WyriHaximus\\Tests\\React\\Cache\\": "tests/"
3026
}
27+
},
28+
"config": {
29+
"sort-packages": true,
30+
"platform": {
31+
"php": "7.0"
32+
}
33+
},
34+
"scripts": {
35+
"ensure-installed": "composer install --ansi -n -q",
36+
"cs": [
37+
"@ensure-installed",
38+
"php-cs-fixer fix --config=.php_cs --ansi --dry-run --diff --verbose --allow-risky=yes --show-progress=estimating"
39+
],
40+
"cs-fix": [
41+
"@ensure-installed",
42+
"php-cs-fixer fix --config=.php_cs --ansi --verbose --allow-risky=yes --show-progress=estimating"
43+
],
44+
"unit": [
45+
"@ensure-installed",
46+
"phpunit --colors=always -c phpunit.xml.dist"
47+
],
48+
"unit-coverage": [
49+
"@ensure-installed",
50+
"phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml --coverage-clover ./build/logs/clover.xml"
51+
],
52+
"lint-php": [
53+
"@ensure-installed",
54+
"parallel-lint --exclude vendor ."
55+
],
56+
"qa-all": [
57+
"@lint-php",
58+
"@cs",
59+
"@unit"
60+
],
61+
"qa-all-coverage": [
62+
"@lint-php",
63+
"@cs",
64+
"@unit-coverage"
65+
],
66+
"qa-windows": [
67+
"@lint-php",
68+
"@cs",
69+
"@unit"
70+
],
71+
"qa-ci": [
72+
"@unit"
73+
],
74+
"qa-ci-extended": [
75+
"@qa-all-coverage"
76+
],
77+
"qa-ci-windows": [
78+
"@qa-windows"
79+
],
80+
"qa-contrib": [
81+
"@qa-all"
82+
],
83+
"ci-coverage": [
84+
"if [ -f ./build/logs/clover.xml ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi"
85+
]
3186
}
3287
}

0 commit comments

Comments
 (0)