mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
pipeline fixes for phpstan, cs-fixer, rector
This commit is contained in:
parent
b9b342fe44
commit
c9e13be736
@ -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']);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
@ -54,8 +55,7 @@ class UserRenderTest extends WebTestCase
|
||||
->setActive(true);
|
||||
$scopeA->setName(['fr' => 'service A']);
|
||||
$user->setLabel('BOB ISLA');
|
||||
// $user->setPhonenumber(PhoneNumberUtil::getInstance()->parse('+32475928635'));
|
||||
|
||||
// $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);
|
||||
@ -114,7 +113,7 @@ class UserRenderTest extends WebTestCase
|
||||
$options['at_date'] = new \DateTime('2023-11-25 12:00:00');
|
||||
$optionsTwo['at_date'] = new \DateTime('2024-01-30 12:00:00');
|
||||
|
||||
// dd($user);
|
||||
// dd($user);
|
||||
|
||||
// Check that the user render for the first activity corresponds with the first user job
|
||||
$expectedStringA = 'BOB ISLA (assistant social) (service A)';
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user