diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 312c551..5aa7fcb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,5 +9,3 @@ on: jobs: ci: uses: shlinkio/github-actions/.github/workflows/php-lib-ci.yml@main - with: - coverage-driver: 'xdebug' diff --git a/CHANGELOG.md b/CHANGELOG.md index a9bfd8b..908e952 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this ### Changed * Switch to xdebug for code coverage reports, as pcov is not marking functions as covered +* Remove references to `ValinorConfigFactory` from `shlinkio/shlink-config`. ### Deprecated * *Nothing* diff --git a/composer.json b/composer.json index 6a8e643..37ed267 100644 --- a/composer.json +++ b/composer.json @@ -30,8 +30,8 @@ "predis/predis": "^2.2", "psr/http-server-middleware": "^1.0", "ramsey/uuid": "^4.7", - "shlinkio/shlink-config": "^3.1", - "shlinkio/shlink-json": "^1.1", + "shlinkio/shlink-config": "^3.3", + "shlinkio/shlink-json": "^1.2", "symfony/cache": "^7.1", "symfony/lock": "^7.1", "symfony/mercure": "^0.6", diff --git a/config/mercure.config.php b/config/mercure.config.php index dd697d2..78be589 100644 --- a/config/mercure.config.php +++ b/config/mercure.config.php @@ -6,7 +6,7 @@ use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory; use Lcobucci\JWT\Configuration; -use Shlinkio\Shlink\Config\Factory\ValinorConfigFactory; +use Psr\Container\ContainerInterface; use Symfony\Component\Mercure\Hub; return [ @@ -19,7 +19,15 @@ Mercure\LcobucciJwtProvider::class => ConfigAbstractFactory::class, Hub::class => Mercure\HubFactory::class, Mercure\MercureHubPublishingHelper::class => ConfigAbstractFactory::class, - Mercure\MercureOptions::class => [ValinorConfigFactory::class, 'config.mercure'], + Mercure\MercureOptions::class => static function (ContainerInterface $c): Mercure\MercureOptions { + $config = $c->get('config.mercure'); + return new Mercure\MercureOptions( + publicHubUrl: $config['public_hub_url'] ?? null, + internalHubUrl: $config['internal_hub_url'] ?? null, + jwtSecret: $config['jwt_secret'] ?? null, + jwtIssuer: $config['jwt_issuer'] ?? 'Shlink', + ); + }, ], ], diff --git a/src/Mercure/MercureOptions.php b/src/Mercure/MercureOptions.php index b4364b8..e78618e 100644 --- a/src/Mercure/MercureOptions.php +++ b/src/Mercure/MercureOptions.php @@ -6,16 +6,16 @@ use function trim; -class MercureOptions +readonly class MercureOptions { /** * @param non-empty-string $jwtIssuer */ public function __construct( - public readonly ?string $publicHubUrl = null, - public readonly ?string $internalHubUrl = null, - public readonly ?string $jwtSecret = null, - public readonly string $jwtIssuer = 'Shlink', + public ?string $publicHubUrl = null, + public ?string $internalHubUrl = null, + public ?string $jwtSecret = null, + public string $jwtIssuer = 'Shlink', ) { }