pipeline fixes for phpstan, cs-fixer, rector

This commit is contained in:
Julie Lenaerts 2024-04-16 20:16:45 +02:00
parent b9b342fe44
commit c9e13be736
3 changed files with 9 additions and 11 deletions

View File

@ -42,7 +42,7 @@ class UserRender implements ChillEntityRenderInterface
}
/**
* @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTime|null} $options
* @param array $options
*
* @throws LoaderError
* @throws RuntimeError
@ -54,7 +54,7 @@ class UserRender implements ChillEntityRenderInterface
if (null === $opts['at_date']) {
$opts['at_date'] = $this->clock->now();
} elseif ($opts['at_date'] instanceof DateTime) {
} elseif ($opts['at_date'] instanceof \DateTime) {
$opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']);
}
@ -65,7 +65,7 @@ class UserRender implements ChillEntityRenderInterface
}
/**
* @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTime|null} $options
* @param array $options
*/
public function renderString($entity, array $options): string
{
@ -75,7 +75,7 @@ class UserRender implements ChillEntityRenderInterface
if (null === $opts['at_date']) {
$opts['at_date'] = $this->clock->now();
} elseif ($opts['at_date'] instanceof DateTime) {
} elseif ($opts['at_date'] instanceof \DateTime) {
$opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']);
}

View File

@ -39,7 +39,8 @@ class UserRenderTest extends WebTestCase
self::bootKernel();
}
#[NoReturn] public function testRenderUserWithJobAndScopeAtCertainDate(): void
#[NoReturn]
public function testRenderUserWithJobAndScopeAtCertainDate(): void
{
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class);
@ -56,7 +57,6 @@ class UserRenderTest extends WebTestCase
$user->setLabel('BOB ISLA');
// $user->setPhonenumber(PhoneNumberUtil::getInstance()->parse('+32475928635'));
$userJobB = new UserJob();
$scopeB = new Scope();
@ -101,8 +101,7 @@ class UserRenderTest extends WebTestCase
$em->flush();
// Create renderer
$translatableStringHelperMock = $this->getMockBuilder(TranslatableStringHelperInterface::class)
->getMock();
$translatableStringHelperMock = $this->createMock(TranslatableStringHelperInterface::class);
$engineMock = $this->createMock(Environment::class);
$translatorMock = $this->createMock(TranslatorInterface::class);

View File

@ -69,7 +69,6 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac
);
}
if ('json' === $format) {
// then, we add normalization for things which are not into the entity
$initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor(