Skip to content

Commit b2cf0b5

Browse files
authored
Merge pull request #49 from packagist/t/php8.1
PHP8.1 support
2 parents 6d22906 + 02d517a commit b2cf0b5

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

.github/workflows/php.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,15 @@ jobs:
3434
run: composer validate
3535

3636
- name: Install dependencies
37-
run: composer install --prefer-dist --no-progress --no-suggest
37+
run: composer install --prefer-dist --no-progress
3838

3939
- name: PHPUnit
4040
run: ./vendor/bin/phpunit tests
4141

4242
- name: PHP-CS-Fixer
4343
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff
44+
env:
45+
PHP_CS_FIXER_IGNORE_ENV: 1
46+
47+
- name: PHPStan
48+
run: ./vendor/bin/phpstan analyze src --no-progress

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"php-http/mock-client": "^1.0",
2626
"guzzlehttp/psr7": "^1.2",
2727
"cache/array-adapter": "^1.1.0",
28-
"friendsofphp/php-cs-fixer": "^3.0"
28+
"friendsofphp/php-cs-fixer": "^3.0",
29+
"phpstan/phpstan": "^1.2"
2930
},
3031
"autoload": {
3132
"psr-4": { "PrivatePackagist\\ApiClient\\": "src/" }

phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
level: 5
3+
paths:
4+
- src
5+
- tests

src/Api/AbstractApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,6 @@ protected function delete($path, array $parameters = [], array $headers = [])
125125
*/
126126
protected function createJsonBody(array $parameters)
127127
{
128-
return (count($parameters) === 0) ? null : json_encode($parameters, empty($parameters) ? JSON_FORCE_OBJECT : 0);
128+
return (count($parameters) === 0) ? null : json_encode($parameters);
129129
}
130130
}

0 commit comments

Comments
 (0)