Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 51 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

strategy:
fail-fast: false
Expand All @@ -33,6 +33,8 @@ jobs:
allowed-to-fail: false
- php: '8.5'
allowed-to-fail: false
- php: '8.6'
allowed-to-fail: true

# Development stability tests
- php: '8.4'
Expand All @@ -41,14 +43,42 @@ jobs:
- php: '8.5'
stability: 'dev'
allowed-to-fail: true
- php: '8.6'
stability: 'dev'
allowed-to-fail: true

# Guzzle 7.0 backwards compatibility tests
- php: '8.1'
guzzle: '7'
allowed-to-fail: false
- php: '8.4'
guzzle: '7'
allowed-to-fail: false
- php: '8.5'
guzzle: '7'
allowed-to-fail: false
- php: '8.6'
guzzle: '7'
allowed-to-fail: true

# Guzzle 8.0 compatibility tests
- php: '8.4'
guzzle: '8'
allowed-to-fail: false
- php: '8.5'
guzzle: '8'
allowed-to-fail: false
- php: '8.6'
guzzle: '8'
allowed-to-fail: true

name: "PHP ${{ matrix.php }}${{ matrix.stability && format(' | {0}', matrix.stability) || '' }}"
name: "PHP ${{ matrix.php }}${{ matrix.guzzle && format(' | Guzzle {0}', matrix.guzzle) || '' }}${{ matrix.stability && format(' | {0}', matrix.stability) || '' }}"

continue-on-error: ${{ matrix.allowed-to-fail }}

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -63,7 +93,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -76,7 +106,14 @@ jobs:
composer config prefer-stable true

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
run: |
if [ "${{ matrix.guzzle }}" = "7" ]; then
composer require "guzzlehttp/guzzle:^7.0" --with-all-dependencies --prefer-dist --no-interaction --no-progress
elif [ "${{ matrix.guzzle }}" = "8" ]; then
composer require "guzzlehttp/guzzle:^8.0" --with-all-dependencies --prefer-dist --no-interaction --no-progress
else
composer install --prefer-dist --no-interaction --no-progress
fi

- name: Validate composer.json and composer.lock
run: composer validate --strict
Expand All @@ -101,12 +138,12 @@ jobs:
composer test-integration -- --testdox

code-quality:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
name: Code Quality Checks

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -121,7 +158,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -134,12 +171,12 @@ jobs:
run: composer validate --strict

coverage:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
name: Code Coverage

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -154,7 +191,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -167,9 +204,10 @@ jobs:
run: composer test-coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v7
with:
file: ./coverage.xml
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ composer.lock

# PHP CS Fixer
.php-cs-fixer.cache
.php-cs-fixer.php

# Coverage reports
coverage/
Expand Down
13 changes: 8 additions & 5 deletions .php-cs-fixer.php → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<?php

declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
->exclude('vendor');
->exclude('vendor')
->exclude('coverage')
->exclude('.phpunit.cache')
->name('*.php');

$config = new PhpCsFixer\Config();
$config->setFinder($finder)
->setRules([
'@PSR12' => true,
'@PSR12:risky' => true,
])
->setRiskyAllowed(true);

// @phpstan-ignore-next-line Method exists but not detected by static analysis
$config->setUnsupportedPhpVersionAllowed(true);
->setRiskyAllowed(true)
->setUnsupportedPhpVersionAllowed(true);

return $config;
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.1.0] - 2026-09-18

### Added

- Support for `guzzlehttp/guzzle` 8.0 alongside 7.0 (`^7.0 || ^8.0`).
- Compatibility testing and CI matrix coverage for PHP 8.1–8.6 and both Guzzle 7 & 8.
- Built-in retry resilience for Discogs rate limits (`429` and `503`) with exponential backoff and `Retry-After` header support.

### Changed

- Upgraded PHPStan to 2.x (Level 8) and GitHub Actions to Node 24 compatible runners.
- Updated default User-Agent version to `4.1.0`.

### Fixed

- Fixed documentation example for `search()` named parameter (`q` instead of `query`) ([#4](https://github.com/calliostro/php-discogs-api/pull/4) by [@JamieBradders](https://github.com/JamieBradders)).

### Removed

- Dropped legacy `guzzlehttp/guzzle` 6.5 constraint.

## [4.0.0](https://github.com/calliostro/php-discogs-api/releases/tag/v4.0.0) – 2025-12-01

### 🚀 Complete Library Redesign – v4.0 is a Fresh Start
Expand Down
Loading