Skip to content

Commit 857e0f3

Browse files
committed
update vendor packages
1 parent ce3e0c2 commit 857e0f3

5 files changed

Lines changed: 15 additions & 13 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ tmp
77
vendor/*
88
runtest.sh
99
.env
10+
.phpunit.result.cache
1011

1112
# osx noise
1213
.DS_Store

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"require": {
1313
"php": "^7.1",
1414
"guzzlehttp/guzzle": "^6.0",
15-
"monolog/monolog": "^1.23"
15+
"monolog/monolog": "^2.1"
1616
},
1717
"require-dev": {
18-
"phpunit/phpunit": "^7.5",
19-
"jakub-onderka/php-parallel-lint": "^1.0",
20-
"keboola/coding-standard": "^7.0",
21-
"phpstan/phpstan-shim": "^0.10.8"
18+
"keboola/coding-standard": "^9.0",
19+
"phpstan/phpstan": "^0.12.59",
20+
"php-parallel-lint/php-parallel-lint": "^1.2",
21+
"phpunit/phpunit": "^9.5"
2222
},
2323
"minimum-stability": "stable",
2424
"autoload": {

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
parameters:
2+
checkMissingIterableValueType: false
23
ignoreErrors:

src/Google/RestApi.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function authorize(string $code, string $redirectUri): array
205205
],
206206
]);
207207

208-
$responseBody = json_decode($response->getBody(), true);
208+
$responseBody = json_decode((string) $response->getBody(), true);
209209

210210
$this->accessToken = $responseBody['access_token'];
211211
$this->refreshToken = $responseBody['refresh_token'];
@@ -251,11 +251,11 @@ public function request(
251251
): Response {
252252
$method = strtolower($method);
253253
if (!in_array($method, ['get', 'head', 'post', 'put', 'patch', 'delete', 'options'])) {
254-
throw new RestApiException("Wrong http method specified", 500);
254+
throw new RestApiException('Wrong http method specified', 500);
255255
}
256256

257-
if (null === $this->refreshToken) {
258-
throw new RestApiException("Refresh token must be set", 400);
257+
if ($this->refreshToken === null) {
258+
throw new RestApiException('Refresh token must be set', 400);
259259
}
260260

261261
$headers = [
@@ -302,7 +302,7 @@ protected function logRetryRequest(
302302
];
303303
}
304304

305-
$this->logger->warning(sprintf("Retrying request (%sx)", $retries), $context);
305+
$this->logger->warning(sprintf('Retrying request (%sx)', $retries), $context);
306306
}
307307
}
308308

tests/RestApiTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ public function testRequest(): void
7777

7878
public function testDelayFn(): void
7979
{
80-
Timer::start();
80+
$timer = new Timer();
81+
$timer->start();
8182

8283
$delayFn = function ($retries) {
8384
return (int) (5000 * pow(2, $retries - 1) + rand(0, 500));
@@ -88,8 +89,7 @@ public function testDelayFn(): void
8889

8990
$response = $restApi->request('/oauth2/v3/userinfo');
9091

91-
Timer::stop();
92-
$time = Timer::timeSinceStartOfRequest();
92+
$time = $timer->stop()->asSeconds();
9393

9494
$body = json_decode($response->getBody()->getContents(), true);
9595

0 commit comments

Comments
 (0)