rector fixes after rector's upgrade

This commit is contained in:
2024-08-28 15:32:57 +02:00
parent e477a49c92
commit 2d82c1e105
6 changed files with 31 additions and 43 deletions

View File

@@ -106,9 +106,7 @@ class RemoveExpiredStoredObjectCronJobTest extends TestCase
false => $messageBus->method('dispatch'),
};
$methodDispatch->willReturnCallback(function (RemoveOldVersionMessage $message) {
return new Envelope($message);
});
$methodDispatch->willReturnCallback(fn (RemoveOldVersionMessage $message) => new Envelope($message));
return $messageBus;
}

View File

@@ -95,9 +95,7 @@ class RemoveOldVersionCronJobTest extends KernelTestCase
false => $messageBus->method('dispatch'),
};
$methodDispatch->willReturnCallback(function (RemoveOldVersionMessage $message) {
return new Envelope($message);
});
$methodDispatch->willReturnCallback(fn (RemoveOldVersionMessage $message) => new Envelope($message));
return $messageBus;
}

View File

@@ -217,13 +217,11 @@ final class StoredObjectManagerTest extends TestCase
->expects($this->once())
->method('generate')
->with($this->identicalTo('DELETE'), $this->identicalTo('object_name'))
->willReturnCallback(function (string $method, string $objectName) {
return new SignedUrl(
$method,
'https://example.com/'.$objectName,
new \DateTimeImmutable('1 hours')
);
});
->willReturnCallback(fn (string $method, string $objectName) => new SignedUrl(
$method,
'https://example.com/'.$objectName,
new \DateTimeImmutable('1 hours')
));
$storedObjectManager = new StoredObjectManager($httpClient, $tempUrlGenerator);
$storedObjectManager->delete($version);
@@ -276,14 +274,12 @@ final class StoredObjectManagerTest extends TestCase
->expects($this->never())
->method('generate')
->with($this->identicalTo('HEAD'), $this->isType('string'))
->willReturnCallback(function (string $method, string $objectName) {
return new SignedUrl(
$method,
'https://example.com/'.$objectName,
new \DateTimeImmutable('1 hours'),
$objectName
);
});
->willReturnCallback(fn (string $method, string $objectName) => new SignedUrl(
$method,
'https://example.com/'.$objectName,
new \DateTimeImmutable('1 hours'),
$objectName
));
$manager = new StoredObjectManager($client, $tempUrlGenerator);
@@ -307,13 +303,11 @@ final class StoredObjectManagerTest extends TestCase
->expects($this->atLeastOnce())
->method('generate')
->with($this->identicalTo('HEAD'), $this->isType('string'))
->willReturnCallback(function (string $method, string $objectName) {
return new SignedUrl(
$method,
'https://example.com/'.$objectName,
new \DateTimeImmutable('1 hours')
);
});
->willReturnCallback(fn (string $method, string $objectName) => new SignedUrl(
$method,
'https://example.com/'.$objectName,
new \DateTimeImmutable('1 hours')
));
$manager = new StoredObjectManager($client, $tempUrlGenerator);
@@ -368,14 +362,12 @@ final class StoredObjectManagerTest extends TestCase
->expects($this->atLeastOnce())
->method('generate')
->with($this->logicalOr($this->identicalTo('GET'), $this->identicalTo('PUT')), $this->isType('string'))
->willReturnCallback(function (string $method, string $objectName) {
return new SignedUrl(
$method,
'https://example.com/'.$objectName,
new \DateTimeImmutable('1 hours'),
$objectName
);
});
->willReturnCallback(fn (string $method, string $objectName) => new SignedUrl(
$method,
'https://example.com/'.$objectName,
new \DateTimeImmutable('1 hours'),
$objectName
));
return $tempUrlGenerator;
}