Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated config options #212

Merged
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this

### Changed
* Update dependencies
* Default value for QR codes enabled for disabled short URLs is now true.

### Deprecated
* *Nothing*

### Removed
* *Nothing*
* Remove config options related with webhooks.
* Remove config option to decode redis credentials.

### Fixed
* *Nothing*
Expand Down
6 changes: 0 additions & 6 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
=> Config\Option\UrlShortener\EnableMultiSegmentSlugsConfigOption::class,
'URL shortener > Trailing slashes' => Config\Option\UrlShortener\EnableTrailingSlashConfigOption::class,
'URL shortener > Mode' => Config\Option\UrlShortener\ShortUrlModeConfigOption::class,
'Webhooks > List' => Config\Option\Visit\VisitsWebhooksConfigOption::class,
'Webhooks > Orphan visits' => Config\Option\Visit\OrphanVisitsWebhooksConfigOption::class,
'GeoLite2 license key' => Config\Option\UrlShortener\GeoLiteLicenseKeyConfigOption::class,
'Redirects > Status code (301/302)' => Config\Option\UrlShortener\RedirectStatusCodeConfigOption::class,
'Redirects > Caching life time' => Config\Option\UrlShortener\RedirectCacheLifeTimeConfigOption::class,
Expand Down Expand Up @@ -104,7 +102,6 @@
],
'INTEGRATIONS' => [
'Redis > servers' => Config\Option\Redis\RedisServersConfigOption::class,
'Redis > decode credentials' => Config\Option\Redis\RedisDecodeCredentialsConfigOption::class,
'Redis > sentinels service' => Config\Option\Redis\RedisSentinelServiceConfigOption::class,
'Redis > Pub/sub enabled' => Config\Option\Redis\RedisPubSubConfigOption::class,
Config\Option\Mercure\EnableMercureConfigOption::class,
Expand Down Expand Up @@ -149,11 +146,8 @@
Config\Option\UrlShortener\EnableTrailingSlashConfigOption::class => InvokableFactory::class,
Config\Option\UrlShortener\ShortUrlModeConfigOption::class => InvokableFactory::class,
Config\Option\Redis\RedisServersConfigOption::class => InvokableFactory::class,
Config\Option\Redis\RedisDecodeCredentialsConfigOption::class => InvokableFactory::class,
Config\Option\Redis\RedisSentinelServiceConfigOption::class => InvokableFactory::class,
Config\Option\Redis\RedisPubSubConfigOption::class => InvokableFactory::class,
Config\Option\Visit\VisitsWebhooksConfigOption::class => InvokableFactory::class,
Config\Option\Visit\OrphanVisitsWebhooksConfigOption::class => InvokableFactory::class,
Config\Option\Worker\TaskWorkerNumConfigOption::class => InvokableFactory::class,
Config\Option\Worker\WebWorkerNumConfigOption::class => InvokableFactory::class,
Config\Option\UrlShortener\ShortCodeLengthOption::class => InvokableFactory::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public function ask(StyleInterface $io, array $currentOptions): bool
'Should Shlink be able to generate QR codes for short URLs which are not enabled? (Short URLs are not '
. 'enabled if they have a "valid since" in the future, a "valid until" in the past, or reached the maximum '
. 'amount of allowed visits)',
// Deprecated. Shlink 4.0.0 should change default value to `true`
false,
);
}
}
38 changes: 0 additions & 38 deletions src/Config/Option/Redis/RedisDecodeCredentialsConfigOption.php

This file was deleted.

8 changes: 1 addition & 7 deletions src/Config/Option/UrlShortener/ShortUrlModeConfigOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
namespace Shlinkio\Shlink\Installer\Config\Option\UrlShortener;

use Shlinkio\Shlink\Installer\Config\Option\BaseConfigOption;
use Shlinkio\Shlink\Installer\Config\Option\ConfigOptionMigratorInterface;
use Symfony\Component\Console\Style\StyleInterface;

use const PHP_EOL;

class ShortUrlModeConfigOption extends BaseConfigOption implements ConfigOptionMigratorInterface
class ShortUrlModeConfigOption extends BaseConfigOption
{
private const MODES = [
'strict' => 'Short codes and custom slugs will be matched in a case-sensitive way ("foo" !== "FOO"). '
Expand All @@ -37,9 +36,4 @@ public function ask(StyleInterface $io, array $currentOptions): string
'strict',
);
}

public function tryToMigrateValue(mixed $currentValue): mixed
{
return $currentValue === 'loosely' ? 'loose' : $currentValue;
}
}
35 changes: 0 additions & 35 deletions src/Config/Option/Visit/OrphanVisitsWebhooksConfigOption.php

This file was deleted.

34 changes: 0 additions & 34 deletions src/Config/Option/Visit/VisitsWebhooksConfigOption.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function expectedQuestionIsAsked(): void
'Should Shlink be able to generate QR codes for short URLs which are not enabled? (Short URLs are not '
. 'enabled if they have a "valid since" in the future, a "valid until" in the past, or reached the maximum '
. 'amount of allowed visits)',
false,
)->willReturn(true);

$answer = $this->configOption->ask($io, []);
Expand Down

This file was deleted.

13 changes: 0 additions & 13 deletions test/Config/Option/UrlShortener/ShortUrlModeConfigOptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,4 @@ public static function provideChoices(): iterable
yield 'strict' => ['strict'];
yield 'loose' => ['loose'];
}

#[Test, DataProvider('provideMigrationValues')]
public function deprecatedValueIsProperlyMigrated(string $existingValue, string $expectedResult): void
{
self::assertEquals($expectedResult, $this->configOption->tryToMigrateValue($existingValue));
}

public static function provideMigrationValues(): iterable
{
yield 'strict' => ['strict', 'strict'];
yield 'loose' => ['loose', 'loose'];
yield 'loosely' => ['loosely', 'loose'];
}
}
69 changes: 0 additions & 69 deletions test/Config/Option/Visit/OrphanVisitsWebhooksConfigOptionTest.php

This file was deleted.

44 changes: 0 additions & 44 deletions test/Config/Option/Visit/VisitsWebhooksConfigOptionTest.php

This file was deleted.

Loading