From 31d3ca3a751ef78db00ca9d067715592c3a3c030 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 12 Jun 2026 10:21:08 +0200 Subject: [PATCH 1/3] Install xdebug in dev docker image using pie --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 11300e4..ac8c491 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM composer:2 +COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie RUN apk add --update linux-headers && \ apk add --no-cache --virtual .phpize-deps ${PHPIZE_DEPS} && \ - pecl install xdebug && \ - docker-php-ext-enable xdebug && \ + pie install xdebug/xdebug && \ apk del .phpize-deps From ba1d2e63f5b0350d892e6a3473c6a504adda74ee Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 12 Jun 2026 10:31:34 +0200 Subject: [PATCH 2/3] Add support for browser redirect conditions --- CHANGELOG.md | 17 +++++++++++++++++ src/RedirectRules/Model/RedirectCondition.php | 6 ++++++ .../Model/RedirectConditionType.php | 1 + src/ShortUrls/Model/Browser.php | 15 +++++++++++++++ .../Model/RedirectConditionTest.php | 11 +++++++++++ 5 files changed, 50 insertions(+) create mode 100644 src/ShortUrls/Model/Browser.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 086876c..a0db77b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). +## [3.3.0] - 2026-06-12 +### Added +* Add support for `browser` redirect conditions, which were introduced in Shlink 5.1.0 + +### Changed +* *Nothing* + +### Deprecated +* *Nothing* + +### Removed +* *Nothing* + +### Fixed +* *Nothing* + + ## [3.2.0] - 2026-05-22 ### Added * *Nothing* diff --git a/src/RedirectRules/Model/RedirectCondition.php b/src/RedirectRules/Model/RedirectCondition.php index c405ec2..0b12c92 100644 --- a/src/RedirectRules/Model/RedirectCondition.php +++ b/src/RedirectRules/Model/RedirectCondition.php @@ -6,6 +6,7 @@ use DateTimeInterface; use JsonSerializable; +use Shlinkio\Shlink\SDK\ShortUrls\Model\Browser; use Shlinkio\Shlink\SDK\ShortUrls\Model\Device; final readonly class RedirectCondition implements JsonSerializable @@ -71,6 +72,11 @@ public static function forAfterDate(DateTimeInterface $date): self return new self(RedirectConditionType::AFTER_DATE, $date->format(DateTimeInterface::ATOM)); } + public static function forBrowser(Browser $browser): self + { + return new self(RedirectConditionType::BROWSER, $browser->value); + } + public static function fromArray(array $payload): self { $originalType = $payload['type'] ?? ''; diff --git a/src/RedirectRules/Model/RedirectConditionType.php b/src/RedirectRules/Model/RedirectConditionType.php index b75de86..74ff49f 100644 --- a/src/RedirectRules/Model/RedirectConditionType.php +++ b/src/RedirectRules/Model/RedirectConditionType.php @@ -16,5 +16,6 @@ enum RedirectConditionType: string case GEOLOCATION_CITY_NAME = 'geolocation-city-name'; case BEFORE_DATE = 'before-date'; case AFTER_DATE = 'after-date'; + case BROWSER = 'browser'; case UNKNOWN = 'unknown'; } diff --git a/src/ShortUrls/Model/Browser.php b/src/ShortUrls/Model/Browser.php new file mode 100644 index 0000000..aa11bed --- /dev/null +++ b/src/ShortUrls/Model/Browser.php @@ -0,0 +1,15 @@ +matchKey); } + #[Test] + public function forBrowserCreatesExpectedCondition(): void + { + $condition = RedirectCondition::forBrowser(Browser::CHROME); + + self::assertEquals(RedirectConditionType::BROWSER, $condition->type); + self::assertEquals(Browser::CHROME->value, $condition->matchValue); + self::assertNull($condition->matchKey); + } + #[Test] public function forIpAddressCreatesExpectedCondition(): void { From 49b077efe01ba1ba7adeb8987fd9858d83c79ca0 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 12 Jun 2026 10:32:58 +0200 Subject: [PATCH 3/3] Add Shlink 5.1 to integration tests matrix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f8842f..33a4425 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: php-version: ['8.4', '8.5'] - shlink-version: ['5.0', '4.6', '4.5', '4.4', '4.3', '4.2', '4.1', '4.0'] + shlink-version: ['5.1', '5.0', '4.6', '4.5', '4.4', '4.3', '4.2', '4.1', '4.0'] shlink-api-version: ['3'] steps: - name: Checkout code