mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
DX: rector rules upt to PHP 74
This commit is contained in:
@@ -114,12 +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 function (User $u) {
|
||||
return $u->getId();
|
||||
}));
|
||||
$this->assertContains(3, $calendar->getUsers()->map(static function (User $u) {
|
||||
return $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()
|
||||
@@ -148,25 +144,17 @@ final class CalendarTypeTest extends TypeTestCase
|
||||
) {
|
||||
$transformer = $this->prophesize($classTransformer);
|
||||
$transformer->transform(Argument::type('array'))
|
||||
->will(static function ($args) {
|
||||
return implode(
|
||||
',',
|
||||
array_map(static function ($p) {
|
||||
return $p->getId();
|
||||
}, $args[0])
|
||||
);
|
||||
});
|
||||
->will(static fn($args) => implode(
|
||||
',',
|
||||
array_map(static fn($p) => $p->getId(), $args[0])
|
||||
));
|
||||
$transformer->transform(Argument::exact(null))
|
||||
->willReturn([]);
|
||||
$transformer->transform(Argument::type(Collection::class))
|
||||
->will(static function ($args) {
|
||||
return implode(
|
||||
',',
|
||||
array_map(static function ($p) {
|
||||
return $p->getId();
|
||||
}, $args[0]->toArray())
|
||||
);
|
||||
});
|
||||
->will(static fn($args) => implode(
|
||||
',',
|
||||
array_map(static fn($p) => $p->getId(), $args[0]->toArray())
|
||||
));
|
||||
$transformer->reverseTransform(Argument::type('string'))
|
||||
->will(static function ($args) use ($objClass) {
|
||||
if (null === $args[0]) {
|
||||
@@ -195,9 +183,7 @@ final class CalendarTypeTest extends TypeTestCase
|
||||
) {
|
||||
$transformer = $this->prophesize($classTransformer);
|
||||
$transformer->transform(Argument::type('object'))
|
||||
->will(static function ($args) {
|
||||
return (string) $args[0]->getId();
|
||||
});
|
||||
->will(static fn($args) => (string) $args[0]->getId());
|
||||
$transformer->transform(Argument::exact(null))
|
||||
->willReturn('');
|
||||
$transformer->reverseTransform(Argument::type('string'))
|
||||
|
@@ -63,9 +63,7 @@ final class AddressConverterTest extends TestCase
|
||||
{
|
||||
$engine = $this->prophesize(EngineInterface::class);
|
||||
$translatableStringHelper = $this->prophesize(TranslatableStringHelperInterface::class);
|
||||
$translatableStringHelper->localize(Argument::type('array'))->will(static function ($args): string {
|
||||
return ($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());
|
||||
|
||||
|
@@ -72,17 +72,13 @@ final class CalendarForShortMessageProviderTest extends TestCase
|
||||
Argument::type(DateTimeImmutable::class),
|
||||
Argument::type('int'),
|
||||
Argument::exact(0)
|
||||
)->will(static function ($args) {
|
||||
return 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 function ($args) {
|
||||
return 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();
|
||||
@@ -108,17 +104,13 @@ final class CalendarForShortMessageProviderTest extends TestCase
|
||||
Argument::type(DateTimeImmutable::class),
|
||||
Argument::type('int'),
|
||||
Argument::exact(0)
|
||||
)->will(static function ($args) {
|
||||
return 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 function ($args) {
|
||||
return [];
|
||||
})->shouldBeCalledTimes(1);
|
||||
)->will(static fn($args) => [])->shouldBeCalledTimes(1);
|
||||
|
||||
$em = $this->prophesize(EntityManagerInterface::class);
|
||||
$em->clear()->shouldBeCalled();
|
||||
|
Reference in New Issue
Block a user