Skip to content

Commit

Permalink
Update dependencies and minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
calliostro committed Jan 3, 2024
1 parent a0fb99d commit ab2f301
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ matrix:
fast_finish: true
include:
# Minimum supported dependencies with the latest and oldest PHP version
- php: 8.2
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
- php: 8.1
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
- php: 8.0
Expand All @@ -30,9 +32,11 @@ matrix:
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text"
- php: 8.1
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text"
- php: 8.2
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text"

# Latest commit to master
- php: 8.1
- php: 8.2
env: STABILITY="dev"

allow_failures:
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Discogs Api
===========

[![Build Status](https://api.travis-ci.com/calliostro/php-discogs-api.png)](https://app.travis-ci.com/github/calliostro/php-discogs-api)
[![Version](https://poser.pugx.org/calliostro/php-discogs-api/version)](//packagist.org/packages/calliostro/php-discogs-api)
[![License](https://poser.pugx.org/calliostro/php-discogs-api/license)](//packagist.org/packages/calliostro/php-discogs-api)

Expand Down Expand Up @@ -243,7 +242,9 @@ foreach ($release['images'] as $image) {

```

### Get user lists
### User lists

#### Get user lists

```php
<?php
Expand All @@ -255,7 +256,7 @@ $userLists = $client->getUserLists([
]);
```

### Get list
#### Get user list items

```php
<?php
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"license": "MIT",
"require": {
"php": ">=7.3",
"guzzlehttp/guzzle": "^7.0 || ^8.0",
"guzzlehttp/guzzle-services": "^1.2",
"guzzlehttp/oauth-subscriber": "^0.4"
"guzzlehttp/guzzle": "^7.0",
"guzzlehttp/guzzle-services": "^1.2|^1.3|^1.4",
"guzzlehttp/oauth-subscriber": "^0.4|^0.5|^0.6"
},
"require-dev": {
"phpunit/phpunit": "^8.5.23 || ^9.0",
"phpunit/phpunit": "^8.5.23|^9.0|^10.0",
"ext-json": "*"
},
"authors": [
Expand All @@ -33,7 +33,7 @@
}
},
"suggest": {
"calliostro/discogs-bundle": "For integrating Discogs into Symfony 5",
"calliostro/discogs-bundle": "For integrating Discogs into Symfony",
"ricbra/discogs-bundle": "For integrating Discogs into Symfony 2"
},
"scripts":{
Expand Down
4 changes: 2 additions & 2 deletions lib/Discogs/ClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public static function factory(array $config = []): DiscogsClient
return new DiscogsClient($client, $description);
}

private static function &mergeRecursive(array &$array1, &$array2 = null): array
private static function &mergeRecursive(array $array1, $array2 = null): array
{
$merged = $array1;

if (is_array($array2)) {
foreach ($array2 as $key => $val) {
if (is_array($val)) {
$merged[$key] = isset($merged[$key]) && is_array($merged[$key]) ?
self::mergeRecursive($merged[$key], $array2[$key]) : $val;
self::mergeRecursive($merged[$key], $val) : $val;
} else {
$merged[$key] = $val;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Discogs/Subscriber/ThrottleSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Discogs\Subscriber;

use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Exception\TransferException;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;

Expand All @@ -27,7 +27,7 @@ public function decider(): callable
int $retries,
Request $request,
Response $response = null,
RequestException $exception = null
TransferException $exception = null
) {
if ($retries >= $this->max_retries) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion tests/Discogs/Test/Subscriber/ThrottleSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testMaxRetries(): void
$client->request('GET', '/');
} catch (Exception $e) {
$this->assertInstanceOf(ClientException::class, $e);
$this->assertEquals($e->getCode(), 429);
$this->assertEquals(429, $e->getCode());
}

$after = microtime(true);
Expand Down

0 comments on commit ab2f301

Please sign in to comment.