DX: fix cs

This commit is contained in:
2023-04-15 00:43:55 +02:00
parent 80647147ee
commit 746ed4f5e5
188 changed files with 309 additions and 308 deletions

View File

@@ -114,8 +114,8 @@ final class CalendarTypeTest extends TypeTestCase
$this->assertEquals(8, $calendar->getCalendarRange()->getId());
$this->assertEquals(9, $calendar->getLocation()->getId());
$this->assertEquals(true, $calendar->getSendSMS());
$this->assertContains(2, $calendar->getUsers()->map(static fn(User $u) => $u->getId()));
$this->assertContains(3, $calendar->getUsers()->map(static fn(User $u) => $u->getId()));
$this->assertContains(2, $calendar->getUsers()->map(static fn (User $u) => $u->getId()));
$this->assertContains(3, $calendar->getUsers()->map(static fn (User $u) => $u->getId()));
}
protected function getExtensions()
@@ -144,16 +144,16 @@ final class CalendarTypeTest extends TypeTestCase
) {
$transformer = $this->prophesize($classTransformer);
$transformer->transform(Argument::type('array'))
->will(static fn($args) => implode(
->will(static fn ($args) => implode(
',',
array_map(static fn($p) => $p->getId(), $args[0])
array_map(static fn ($p) => $p->getId(), $args[0])
));
$transformer->transform(Argument::exact(null))
->willReturn([]);
$transformer->transform(Argument::type(Collection::class))
->will(static fn($args) => implode(
->will(static fn ($args) => implode(
',',
array_map(static fn($p) => $p->getId(), $args[0]->toArray())
array_map(static fn ($p) => $p->getId(), $args[0]->toArray())
));
$transformer->reverseTransform(Argument::type('string'))
->will(static function ($args) use ($objClass) {
@@ -183,7 +183,7 @@ final class CalendarTypeTest extends TypeTestCase
) {
$transformer = $this->prophesize($classTransformer);
$transformer->transform(Argument::type('object'))
->will(static fn($args) => (string) $args[0]->getId());
->will(static fn ($args) => (string) $args[0]->getId());
$transformer->transform(Argument::exact(null))
->willReturn('');
$transformer->reverseTransform(Argument::type('string'))

View File

@@ -63,7 +63,7 @@ final class AddressConverterTest extends TestCase
{
$engine = $this->prophesize(EngineInterface::class);
$translatableStringHelper = $this->prophesize(TranslatableStringHelperInterface::class);
$translatableStringHelper->localize(Argument::type('array'))->will(static fn($args): string => ($args[0] ?? ['fr' => 'not provided'])['fr'] ?? 'not provided');
$translatableStringHelper->localize(Argument::type('array'))->will(static fn ($args): string => ($args[0] ?? ['fr' => 'not provided'])['fr'] ?? 'not provided');
$addressRender = new AddressRender($engine->reveal(), $translatableStringHelper->reveal());

View File

@@ -72,13 +72,13 @@ final class CalendarForShortMessageProviderTest extends TestCase
Argument::type(DateTimeImmutable::class),
Argument::type('int'),
Argument::exact(0)
)->will(static fn($args) => array_fill(0, $args[2], new Calendar()))->shouldBeCalledTimes(1);
)->will(static fn ($args) => array_fill(0, $args[2], new Calendar()))->shouldBeCalledTimes(1);
$calendarRepository->findByNotificationAvailable(
Argument::type(DateTimeImmutable::class),
Argument::type(DateTimeImmutable::class),
Argument::type('int'),
Argument::not(0)
)->will(static fn($args) => array_fill(0, $args[2] - 1, new Calendar()))->shouldBeCalledTimes(1);
)->will(static fn ($args) => array_fill(0, $args[2] - 1, new Calendar()))->shouldBeCalledTimes(1);
$em = $this->prophesize(EntityManagerInterface::class);
$em->clear()->shouldBeCalled();
@@ -104,13 +104,13 @@ final class CalendarForShortMessageProviderTest extends TestCase
Argument::type(DateTimeImmutable::class),
Argument::type('int'),
Argument::exact(0)
)->will(static fn($args) => array_fill(0, 1, new Calendar()))->shouldBeCalledTimes(1);
)->will(static fn ($args) => array_fill(0, 1, new Calendar()))->shouldBeCalledTimes(1);
$calendarRepository->findByNotificationAvailable(
Argument::type(DateTimeImmutable::class),
Argument::type(DateTimeImmutable::class),
Argument::type('int'),
Argument::not(0)
)->will(static fn($args) => [])->shouldBeCalledTimes(1);
)->will(static fn ($args) => [])->shouldBeCalledTimes(1);
$em = $this->prophesize(EntityManagerInterface::class);
$em->clear()->shouldBeCalled();