mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 00:55:01 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -13,15 +13,13 @@ namespace Chill\DocGeneratorBundle\Service\Context;
|
||||
|
||||
use Chill\MainBundle\Entity\Location;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use DateTimeImmutable;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
|
||||
class BaseContextData
|
||||
{
|
||||
public function __construct(private readonly NormalizerInterface $normalizer) {}
|
||||
|
||||
public function getData(?User $user = null): array
|
||||
public function getData(User $user = null): array
|
||||
{
|
||||
$data = [];
|
||||
|
||||
@@ -30,11 +28,11 @@ class BaseContextData
|
||||
'docgen',
|
||||
['docgen:expects' => User::class, 'groups' => ['docgen:read']]
|
||||
);
|
||||
$data['createdAt'] = $this->normalizer->normalize(new DateTimeImmutable(), 'docgen', [
|
||||
'docgen:expects' => DateTimeImmutable::class, 'groups' => ['docgen:read'],
|
||||
$data['createdAt'] = $this->normalizer->normalize(new \DateTimeImmutable(), 'docgen', [
|
||||
'docgen:expects' => \DateTimeImmutable::class, 'groups' => ['docgen:read'],
|
||||
]);
|
||||
$data['createdAtDate'] = $this->normalizer->normalize(new DateTimeImmutable('today'), 'docgen', [
|
||||
'docgen:expects' => DateTimeImmutable::class, 'groups' => ['docgen:read'],
|
||||
$data['createdAtDate'] = $this->normalizer->normalize(new \DateTimeImmutable('today'), 'docgen', [
|
||||
'docgen:expects' => \DateTimeImmutable::class, 'groups' => ['docgen:read'],
|
||||
]);
|
||||
$data['location'] = $this->normalizer->normalize(
|
||||
$user instanceof User ? $user->getCurrentLocation() : null,
|
||||
|
Reference in New Issue
Block a user