Skip to content

Commit 1f88358

Browse files
authored
Drop support for PHP 7.0 and PHP 7.1 (End of life) (#1068)
* Drop support for PHP < 7.2 in composer.json * Update .travis.yml Drop PHP 7.0 abd 7.1 Add PHP 7.4 * Normalize composer.json files Using composer-normalize * Normalize composer.json files (1) Using composer-normalize * Fix TomTom testReverseError400 - Will return JSON instead of XML ; - If API error, returns empty address collection ; * Apply fixes from StyleCI * Upgrade to PHPUnit 7 + Upgrade `nyholm/psr7` * Normalize providers Travis config
1 parent d6f45a4 commit 1f88358

Some content is hidden

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

83 files changed

+752
-722
lines changed

.travis.yml

+45-47
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ branches:
1313

1414
env:
1515
global:
16-
- MIN_PHP=7.0
16+
- MIN_PHP=7.2
1717

1818
cache:
1919
directories:
@@ -22,65 +22,63 @@ cache:
2222
matrix:
2323
fast_finish: true
2424
include:
25-
- php: 7.3
25+
- php: 7.4
2626
env: deps="low"
27-
- php: 7.3
27+
- php: 7.4
2828
env: deps="high"
29-
- php: 7.0
30-
- php: 7.1
3129
- php: 7.2
3230
- php: 7.3
31+
- php: 7.4
3332

3433
before_install:
3534
- |
36-
# General configuration
37-
stty cols 120
38-
PHP=$TRAVIS_PHP_VERSION
39-
[ -d ~/.composer ] || mkdir ~/.composer
40-
export PHPUNIT=$(readlink -f ./phpunit)
41-
export PHPUNIT_X="$PHPUNIT --exclude-group benchmark"
42-
export COMPOSER_UP='composer update --no-progress --no-suggest --ansi --prefer-dist'
35+
# General configuration
36+
stty cols 120
37+
PHP=$TRAVIS_PHP_VERSION
38+
[ -d ~/.composer ] || mkdir ~/.composer
39+
export PHPUNIT=$(readlink -f ./phpunit)
40+
export PHPUNIT_X="$PHPUNIT --exclude-group benchmark"
41+
export COMPOSER_UP='composer update --no-progress --no-suggest --ansi --prefer-dist'
4342
44-
# If "geoip-1.1.1" exits in a provider's .travis.yml, then install the dependency.
45-
export GEOIP_EXT_INSTALL='(grep -Fq "geoip-1.1.1" .travis.yml && sleep 30 && pecl install geoip-1.1.1 && echo "Installed php-geoip") || echo "Did not install php-geoip"'
46-
export GEOIP_EXT_REMOVE='(grep -Fq "geoip-1.1.1" .travis.yml && sleep 30 && pecl uninstall geoip-1.1.1 && echo "Removed php-geoip") || echo "php-geoip not installed"'
43+
# If "geoip-1.1.1" exits in a provider's .travis.yml, then install the dependency.
44+
export GEOIP_EXT_INSTALL='(grep -Fq "geoip-1.1.1" .travis.yml && sleep 30 && pecl install geoip-1.1.1 && echo "Installed php-geoip") || echo "Did not install php-geoip"'
45+
export GEOIP_EXT_REMOVE='(grep -Fq "geoip-1.1.1" .travis.yml && sleep 30 && pecl uninstall geoip-1.1.1 && echo "Removed php-geoip") || echo "php-geoip not installed"'
4746
48-
# tfold is a helper to create folded reports
49-
tfold () {
50-
title=$1
51-
fold=$(echo $title | sed -r 's/[^-_A-Za-z\d]+/./g')
52-
shift
53-
echo -e "travis_fold:start:$fold\\n\\e[1;34m$title\\e[0m"
54-
bash -xc "$*" 2>&1 &&
55-
echo -e "\\e[32mOK\\e[0m $title\\n\\ntravis_fold:end:$fold" ||
56-
( echo -e "\\e[41mKO\\e[0m $title\\n" && exit 1 )
57-
}
58-
export -f tfold
47+
# tfold is a helper to create folded reports
48+
tfold () {
49+
title=$1
50+
fold=$(echo $title | sed -r 's/[^-_A-Za-z\d]+/./g')
51+
shift
52+
echo -e "travis_fold:start:$fold\\n\\e[1;34m$title\\e[0m"
53+
bash -xc "$*" 2>&1 &&
54+
echo -e "\\e[32mOK\\e[0m $title\\n\\ntravis_fold:end:$fold" ||
55+
( echo -e "\\e[41mKO\\e[0m $title\\n" && exit 1 )
56+
}
57+
export -f tfold
5958
60-
COMPONENTS=$(find src -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n')
59+
COMPONENTS=$(find src -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n')
6160
62-
# php.ini configuration
63-
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
64-
phpenv config-rm xdebug.ini || echo "xdebug not available"
65-
echo memory_limit = -1 >> $INI
61+
# php.ini configuration
62+
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
63+
phpenv config-rm xdebug.ini || echo "xdebug not available"
64+
echo memory_limit = -1 >> $INI
6665
6766
install:
68-
- if [[ ! $skip ]]; then $COMPOSER_UP; fi
69-
- |
70-
run_tests () {
71-
set -e
72-
if [[ $skip ]]; then
73-
echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
74-
elif [[ $deps = high ]]; then
75-
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $GEOIP_EXT_INSTALL && $COMPOSER_UP && $PHPUNIT_X$LEGACY && $GEOIP_EXT_REMOVE'"
76-
elif [[ $deps = low ]]; then
77-
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $GEOIP_EXT_INSTALL && $COMPOSER_UP --prefer-lowest --prefer-stable && $PHPUNIT_X && $GEOIP_EXT_REMOVE'"
78-
else
79-
echo "$COMPONENTS" | parallel --gnu "tfold {} $PHPUNIT_X {}"
80-
tfold tty-group $PHPUNIT --group tty
81-
fi
82-
}
67+
- if [[ ! $skip ]]; then $COMPOSER_UP; fi
68+
- |
69+
run_tests () {
70+
set -e
71+
if [[ $skip ]]; then
72+
echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
73+
elif [[ $deps = high ]]; then
74+
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $GEOIP_EXT_INSTALL && $COMPOSER_UP && $PHPUNIT_X$LEGACY && $GEOIP_EXT_REMOVE'"
75+
elif [[ $deps = low ]]; then
76+
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $GEOIP_EXT_INSTALL && $COMPOSER_UP --prefer-lowest --prefer-stable && $PHPUNIT_X && $GEOIP_EXT_REMOVE'"
77+
else
78+
echo "$COMPONENTS" | parallel --gnu "tfold {} $PHPUNIT_X {}"
79+
tfold tty-group $PHPUNIT --group tty
80+
fi
81+
}
8382
8483
script:
8584
- (run_tests)
86-

composer.json

+36-26
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
"name": "geocoder-php/geocoder",
33
"type": "library",
44
"description": "A development package for all providers",
5-
"keywords": ["geocoder", "geocoding", "abstraction", "geoip"],
5+
"keywords": [
6+
"geocoder",
7+
"geocoding",
8+
"abstraction",
9+
"geoip"
10+
],
611
"homepage": "http://geocoder-php.org",
712
"license": "MIT",
813
"authors": [
@@ -12,53 +17,58 @@
1217
}
1318
],
1419
"require": {
15-
"php": "^7.0",
20+
"php": "^7.2",
1621
"igorw/get-in": "^1.0",
17-
"psr/http-message-implementation": "^1.0",
18-
"psr/log": "^1.0",
1922
"php-http/client-implementation": "^1.0",
20-
"php-http/message-factory": "^1.0.2",
21-
"php-http/httplug": "^1.0",
2223
"php-http/discovery": "^1.4",
23-
"psr/simple-cache": "^1.0",
24-
"php-http/promise": "^1.0"
24+
"php-http/httplug": "^1.0",
25+
"php-http/message-factory": "^1.0.2",
26+
"php-http/promise": "^1.0",
27+
"psr/http-message-implementation": "^1.0",
28+
"psr/log": "^1.0",
29+
"psr/simple-cache": "^1.0"
2530
},
2631
"require-dev": {
27-
"phpunit/phpunit": "^6.5 || ^7.5",
32+
"cache/array-adapter": "^1.0",
33+
"cache/simple-cache-bridge": "^1.0",
34+
"cache/void-adapter": "^1.0",
2835
"geocoder-php/provider-integration-tests": "^1.0",
2936
"geoip2/geoip2": "~2.0",
30-
"symfony/stopwatch": "~2.5",
31-
"php-http/message": "^1.0",
37+
"nyholm/nsa": "^1.1",
38+
"nyholm/psr7": "^1.0",
3239
"php-http/curl-client": "^1.7",
40+
"php-http/message": "^1.0",
3341
"php-http/mock-client": "^1.0",
34-
"nyholm/psr7": "^0.2.2",
35-
"nyholm/nsa": "^1.1",
36-
"cache/simple-cache-bridge": "^1.0",
37-
"cache/array-adapter": "^1.0",
38-
"cache/void-adapter": "^1.0"
42+
"phpunit/phpunit": "^7.5",
43+
"symfony/stopwatch": "~2.5"
3944
},
4045
"suggest": {
4146
"ext-geoip": "Enabling the geoip extension allows you to use the MaxMindProvider.",
4247
"geoip/geoip": "If you are going to use the MaxMindBinaryProvider (conflict with geoip extension).",
4348
"geoip2/geoip2": "If you are going to use the GeoIP2DatabaseProvider.",
4449
"symfony/stopwatch": "If you want to use the TimedGeocoder"
4550
},
51+
"extra": {
52+
"branch-alias": {
53+
"dev-master": "4.0-dev"
54+
}
55+
},
4656
"autoload": {
4757
"psr-4": {
48-
"Geocoder\\": ["src/Common", "src/"]
58+
"Geocoder\\": [
59+
"src/Common",
60+
"src/"
61+
]
4962
}
5063
},
5164
"autoload-dev": {
52-
"psr-4": { "Geocoder\\Tests\\": "tests/" }
53-
},
54-
"scripts": {
55-
"test": "vendor/bin/phpunit"
65+
"psr-4": {
66+
"Geocoder\\Tests\\": "tests/"
67+
}
5668
},
5769
"minimum-stability": "dev",
5870
"prefer-stable": true,
59-
"extra": {
60-
"branch-alias": {
61-
"dev-master": "4.0-dev"
62-
}
71+
"scripts": {
72+
"test": "vendor/bin/phpunit"
6373
}
64-
}
74+
}

phpunit.xml.dist

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
convertWarningsToExceptions="true"
88
processIsolation="false"
99
stopOnFailure="false"
10-
syntaxCheck="false"
1110
bootstrap="vendor/autoload.php"
1211
>
1312
<php>

src/Common/.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sudo: false
44
php: 7.2
55

66
install:
7-
- composer update --prefer-stable --prefer-dist
7+
- composer update --prefer-stable --prefer-dist
88

99
script:
1010
- composer test-ci

src/Common/composer.json

+19-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
"name": "willdurand/geocoder",
33
"type": "library",
44
"description": "Common files for PHP Geocoder",
5-
"keywords": ["geocoder", "geocoding", "abstraction", "geoip"],
5+
"keywords": [
6+
"geocoder",
7+
"geocoding",
8+
"abstraction",
9+
"geoip"
10+
],
611
"homepage": "http://geocoder-php.org",
712
"license": "MIT",
813
"authors": [
@@ -12,29 +17,31 @@
1217
}
1318
],
1419
"require": {
15-
"php": "^7.0"
20+
"php": "^7.2"
1621
},
1722
"require-dev": {
18-
"phpunit/phpunit": "^6.5 || ^7.5",
19-
"symfony/stopwatch": "~2.5",
20-
"nyholm/nsa": "^1.1"
23+
"nyholm/nsa": "^1.1",
24+
"phpunit/phpunit": "^7.5",
25+
"symfony/stopwatch": "~2.5"
2126
},
2227
"suggest": {
2328
"symfony/stopwatch": "If you want to use the TimedGeocoder"
2429
},
30+
"extra": {
31+
"branch-alias": {
32+
"dev-master": "4.1-dev"
33+
}
34+
},
2535
"autoload": {
26-
"psr-4": { "Geocoder\\": "" },
36+
"psr-4": {
37+
"Geocoder\\": ""
38+
},
2739
"exclude-from-classmap": [
2840
"/Tests/"
2941
]
3042
},
3143
"scripts": {
3244
"test": "vendor/bin/phpunit",
3345
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
34-
},
35-
"extra": {
36-
"branch-alias": {
37-
"dev-master": "4.1-dev"
38-
}
3946
}
40-
}
47+
}

src/Http/.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ sudo: false
44
php: 7.2
55

66
install:
7-
- composer update --prefer-stable --prefer-dist
7+
- composer update --prefer-stable --prefer-dist
88

99
script:
1010
- composer test-ci
1111

1212
after_success:
1313
- wget https://scrutinizer-ci.com/ocular.phar
1414
- php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml
15-

src/Http/composer.json

+22-18
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"name": "geocoder-php/common-http",
33
"type": "library",
44
"description": "Common files for HTTP based Geocoders",
5-
"keywords": ["http geocoder"],
5+
"keywords": [
6+
"http geocoder"
7+
],
68
"homepage": "http://geocoder-php.org",
79
"license": "MIT",
810
"authors": [
@@ -12,37 +14,39 @@
1214
}
1315
],
1416
"require": {
15-
"php": "^7.0",
16-
"willdurand/geocoder": "^4.0",
17+
"php": "^7.2",
18+
"php-http/client-implementation": "^1.0",
19+
"php-http/discovery": "^1.6",
1720
"php-http/httplug": "^1.0 || ^2.0",
18-
"psr/http-message": "^1.0",
1921
"php-http/message-factory": "^1.0.2",
22+
"psr/http-message": "^1.0",
2023
"psr/http-message-implementation": "^1.0",
21-
"php-http/client-implementation": "^1.0",
22-
"php-http/discovery": "^1.6"
24+
"willdurand/geocoder": "^4.0"
2325
},
2426
"require-dev": {
25-
"phpunit/phpunit": "^6.5 || ^7.5",
26-
"symfony/stopwatch": "~2.5",
27+
"nyholm/psr7": "^1.0",
2728
"php-http/message": "^1.0",
2829
"php-http/mock-client": "^1.0",
29-
"nyholm/psr7": "^1.0"
30+
"phpunit/phpunit": "^7.5",
31+
"symfony/stopwatch": "~2.5"
32+
},
33+
"extra": {
34+
"branch-alias": {
35+
"dev-master": "4.0-dev"
36+
}
3037
},
3138
"autoload": {
32-
"psr-4": { "Geocoder\\Http\\": "" },
39+
"psr-4": {
40+
"Geocoder\\Http\\": ""
41+
},
3342
"exclude-from-classmap": [
3443
"/Tests/"
3544
]
3645
},
46+
"minimum-stability": "dev",
47+
"prefer-stable": true,
3748
"scripts": {
3849
"test": "vendor/bin/phpunit",
3950
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
40-
},
41-
"minimum-stability": "dev",
42-
"prefer-stable": true,
43-
"extra": {
44-
"branch-alias": {
45-
"dev-master": "4.0-dev"
46-
}
4751
}
48-
}
52+
}

src/Plugin/.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ sudo: false
44
php: 7.2
55

66
install:
7-
- composer update --prefer-stable --prefer-dist
7+
- composer update --prefer-stable --prefer-dist
88

99
script:
1010
- composer test-ci
1111

1212
after_success:
1313
- wget https://scrutinizer-ci.com/ocular.phar
1414
- php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml
15-

0 commit comments

Comments
 (0)