mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 04:03:12 +08:00
Adjust tests to fix warnings
This commit is contained in:
@@ -71,6 +71,7 @@ class RedirectRuleHandlerTest extends TestCase
|
||||
#[Test, DataProvider('provideExitActions')]
|
||||
public function rulesAreDisplayedWhenRulesListIsEmpty(
|
||||
RedirectRuleHandlerAction $action,
|
||||
array|null $_,
|
||||
): void {
|
||||
$comment = fn (string $value) => sprintf('<comment>%s</comment>', $value);
|
||||
|
||||
|
||||
@@ -81,11 +81,11 @@ class ShortUrlRepositoryAdapterTest extends TestCase
|
||||
yield ['search'];
|
||||
yield ['search', []];
|
||||
yield ['search', ['foo', 'bar']];
|
||||
yield ['search', ['foo', 'bar'], null, null, 'longUrl'];
|
||||
yield ['search', ['foo', 'bar'], Chronos::now()->toAtomString(), null, 'longUrl'];
|
||||
yield ['search', ['foo', 'bar'], null, Chronos::now()->toAtomString(), 'longUrl'];
|
||||
yield ['search', ['foo', 'bar'], Chronos::now()->toAtomString(), Chronos::now()->toAtomString(), 'longUrl'];
|
||||
yield [null, ['foo', 'bar'], Chronos::now()->toAtomString(), null, 'longUrl'];
|
||||
yield ['search', ['foo', 'bar'], null, null];
|
||||
yield ['search', ['foo', 'bar'], Chronos::now()->toAtomString(), null];
|
||||
yield ['search', ['foo', 'bar'], null, Chronos::now()->toAtomString()];
|
||||
yield ['search', ['foo', 'bar'], Chronos::now()->toAtomString(), Chronos::now()->toAtomString()];
|
||||
yield [null, ['foo', 'bar'], Chronos::now()->toAtomString(), null];
|
||||
yield [null, ['foo', 'bar'], Chronos::now()->toAtomString()];
|
||||
yield [null, ['foo', 'bar'], Chronos::now()->toAtomString(), Chronos::now()->toAtomString()];
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class DeleteShortUrlAction extends AbstractRestAction
|
||||
protected const string ROUTE_PATH = '/short-urls/{shortCode}';
|
||||
protected const array ROUTE_ALLOWED_METHODS = [self::METHOD_DELETE];
|
||||
|
||||
public function __construct(private DeleteShortUrlServiceInterface $deleteShortUrlService)
|
||||
public function __construct(private readonly DeleteShortUrlServiceInterface $deleteShortUrlService)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class DeleteShortUrlAction extends AbstractRestAction
|
||||
$identifier = ShortUrlIdentifier::fromApiRequest($request);
|
||||
$apiKey = AuthenticationMiddleware::apiKeyFromRequest($request);
|
||||
|
||||
$this->deleteShortUrlService->deleteByShortCode($identifier, false, $apiKey);
|
||||
$this->deleteShortUrlService->deleteByShortCode($identifier, apiKey: $apiKey);
|
||||
|
||||
return new EmptyResponse();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user