Skip to content

Commit 91cd089

Browse files
authored
Github actions: Add 8.3 to testing matrix, add PHPStan check (#13)
* Add PHP 8.3 to github actions tests * Install PHPStan and add level 5 checks to github actions
1 parent bbe27ad commit 91cd089

File tree

4 files changed

+72
-4
lines changed

4 files changed

+72
-4
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
# https://www.php.net/supported-versions.php
17-
php-version: ['8.1', '8.2']
17+
php-version: ['8.1', '8.2', '8.3']
1818

1919
name: PHP OpenCage Geocode
2020

@@ -39,3 +39,6 @@ jobs:
3939
./vendor/bin/phpunit
4040
./vendor/bin/phpcs .
4141
SKIP_CURL=1 ./vendor/bin/phpunit
42+
43+
- name: Run PHPStan
44+
run: ./vendor/bin/phpstan analyse --level 5 src tests demo

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
},
2020
"require-dev": {
2121
"phpunit/phpunit": "~10.0",
22-
"squizlabs/php_codesniffer": "^3.7"
22+
"squizlabs/php_codesniffer": "^3.7",
23+
"phpstan/phpstan": "^1.10"
2324
},
2425
"archive": {
2526
"exclude": ["vendor", ".DS_Store"]

composer.lock

Lines changed: 64 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AbstractGeocoder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ protected function getJSONByFopen($query)
5757
$ret = @file_get_contents($query);
5858

5959
if ($ret === false) {
60+
/** NOTE: https://github.com/phpstan/phpstan/issues/3213 */
61+
/** @phpstan-ignore-next-line */
6062
if (isset($http_response_header) && is_array($http_response_header)) {
6163
$error_message = $http_response_header[0];
6264
if ($error = error_get_last()) {

0 commit comments

Comments
 (0)