Adjust tests to fix warnings

This commit is contained in:
Alejandro Celaya
2025-06-24 19:47:18 +02:00
parent 497429e685
commit f1157aa177
3 changed files with 8 additions and 7 deletions

View File

@@ -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);

View File

@@ -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()];
}

View File

@@ -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();
}