From 6ff21edf6e71638bca45673b1ac005f0eaa2a3ac Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 12 May 2026 09:01:10 +0200 Subject: [PATCH 1/2] Remove superfluous array_unique where TagsConverter is used --- composer.json | 2 +- .../Command/ShortUrl/Input/ShortUrlDataInput.php | 7 +------ module/Core/src/ShortUrl/Model/ShortUrlsParams.php | 13 ++----------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 7efc6473..972f4e33 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "pagerfanta/core": "^3.8", "ramsey/uuid": "^4.7", "shlinkio/doctrine-specification": "^2.2", - "shlinkio/shlink-common": "^8.2", + "shlinkio/shlink-common": "dev-main#f27cf71 as 9.0", "shlinkio/shlink-config": "^4.1.0", "shlinkio/shlink-event-dispatcher": "^4.4.0", "shlinkio/shlink-importer": "^5.7.0", diff --git a/module/CLI/src/Command/ShortUrl/Input/ShortUrlDataInput.php b/module/CLI/src/Command/ShortUrl/Input/ShortUrlDataInput.php index b7c1f240..957df7ca 100644 --- a/module/CLI/src/Command/ShortUrl/Input/ShortUrlDataInput.php +++ b/module/CLI/src/Command/ShortUrl/Input/ShortUrlDataInput.php @@ -7,7 +7,6 @@ namespace Shlinkio\Shlink\CLI\Command\ShortUrl\Input; use Symfony\Component\Console\Attribute\Option; use function array_filter; -use function array_unique; use function get_object_vars; /** @@ -17,11 +16,7 @@ final class ShortUrlDataInput { /** @var string[]|null */ #[Option('Tags to apply to the short URL', name: 'tag', shortcut: 't')] - // phpcs:disable PSR2.Classes.PropertyDeclaration.Multiple - public array|null $tags = null { - // phpcs:disable PSR2.Classes.PropertyDeclaration.Multiple, PSR2.Classes.PropertyDeclaration.ScopeMissing - set(array | null $value) => $value !== null ? array_unique($value) : $value; - } + public array|null $tags = null; #[Option( 'The date from which this short URL will be valid. ' diff --git a/module/Core/src/ShortUrl/Model/ShortUrlsParams.php b/module/Core/src/ShortUrl/Model/ShortUrlsParams.php index 4b527ce8..9e9ba53a 100644 --- a/module/Core/src/ShortUrl/Model/ShortUrlsParams.php +++ b/module/Core/src/ShortUrl/Model/ShortUrlsParams.php @@ -10,7 +10,6 @@ use Shlinkio\Shlink\Common\Util\DateRange; use Shlinkio\Shlink\Core\Model\Ordering; use Shlinkio\Shlink\Core\ObjectMapper\OrderingConverter; -use function array_unique; use function Shlinkio\Shlink\Common\buildDateRange; use function Shlinkio\Shlink\Common\normalizeOptionalDate; @@ -22,10 +21,6 @@ final readonly class ShortUrlsParams public const int DEFAULT_ITEMS_PER_PAGE = 10; public DateRange|null $dateRange; - /** @var string[] */ - public array $tags; - /** @var string[] */ - public array $excludeTags; /** * @param string[] $tags @@ -36,7 +31,7 @@ final readonly class ShortUrlsParams public int $itemsPerPage = self::DEFAULT_ITEMS_PER_PAGE, public string|null $searchTerm = null, #[TagsConverter] - array $tags = [], + public array $tags = [], #[OrderingConverter(OrderableField::class)] public Ordering $orderBy = new Ordering(), DateTimeInterface|string|null $startDate = null, @@ -46,7 +41,7 @@ final readonly class ShortUrlsParams public TagsMode $tagsMode = TagsMode::ANY, public string|null $domain = null, #[TagsConverter] - array $excludeTags = [], + public array $excludeTags = [], public TagsMode $excludeTagsMode = TagsMode::ANY, public string|null $apiKeyName = null, ) { @@ -54,9 +49,5 @@ final readonly class ShortUrlsParams normalizeOptionalDate($startDate), normalizeOptionalDate($endDate), ); - - // FIXME When using shlink-common, TagsConverter implicitly does an array_unique. - $this->tags = array_unique($tags); - $this->excludeTags = array_unique($excludeTags); } } From c0815b8dcdecc299179cb7a42ab2c125a7a9a3ef Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 12 May 2026 09:25:36 +0200 Subject: [PATCH 2/2] Update to laminas/laminas-servicemanager 4 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 972f4e33..0b390717 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "jaybizzle/crawler-detect": "^1.3", "laminas/laminas-config-aggregator": "^1.17", "laminas/laminas-diactoros": "^3.5", - "laminas/laminas-servicemanager": "^3.23", + "laminas/laminas-servicemanager": "^4.5", "laminas/laminas-stdlib": "^3.20", "league/csv": "^9.28", "matomo/matomo-php-tracker": "^3.3",