mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
php style fixer
This commit is contained in:
@@ -35,14 +35,15 @@ class UserRender implements ChillEntityRenderInterface
|
||||
|
||||
public function __construct(
|
||||
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||
private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator,
|
||||
private readonly \Twig\Environment $engine,
|
||||
private readonly TranslatorInterface $translator,
|
||||
private readonly ClockInterface $clock,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $entity
|
||||
* @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTime} $options
|
||||
* @return string
|
||||
* @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|\DateTime|null} $options
|
||||
*
|
||||
* @throws LoaderError
|
||||
* @throws RuntimeError
|
||||
* @throws SyntaxError
|
||||
@@ -53,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']);
|
||||
}
|
||||
|
||||
@@ -64,19 +65,17 @@ class UserRender implements ChillEntityRenderInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $entity
|
||||
* @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTimeMutable} $options
|
||||
* @return string
|
||||
* @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTimeMutable|null} $options
|
||||
*/
|
||||
public function renderString($entity, array $options): string
|
||||
{
|
||||
$opts = \array_merge(self::DEFAULT_OPTIONS, $options);
|
||||
|
||||
// $immutableAtDate = $opts['at_date'] instanceOf DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date'];
|
||||
// $immutableAtDate = $opts['at_date'] instanceOf DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date'];
|
||||
|
||||
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']);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user