mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Use readonly properties in constructors for better immutability.
Converted constructor properties to readonly where applicable, ensuring immutability and promoting safer code practices. Updated throwable class reference for clarity and consistency.
This commit is contained in:
parent
1955249a60
commit
aebeca1d7a
@ -28,11 +28,11 @@ use Symfony\Component\Serializer\SerializerInterface;
|
|||||||
class ExportGenerationCreateFromSavedExportController
|
class ExportGenerationCreateFromSavedExportController
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private Security $security,
|
private readonly Security $security,
|
||||||
private EntityManagerInterface $entityManager,
|
private readonly EntityManagerInterface $entityManager,
|
||||||
private MessageBusInterface $messageBus,
|
private readonly MessageBusInterface $messageBus,
|
||||||
private ClockInterface $clock,
|
private readonly ClockInterface $clock,
|
||||||
private SerializerInterface $serializer,
|
private readonly SerializerInterface $serializer,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
#[Route('/api/1.0/main/export/export-generation/create-from-saved-export/{id}', methods: ['POST'])]
|
#[Route('/api/1.0/main/export/export-generation/create-from-saved-export/{id}', methods: ['POST'])]
|
||||||
|
@ -24,9 +24,9 @@ class OnExportGenerationFails implements EventSubscriberInterface
|
|||||||
private const LOG_PREFIX = '[export_generation failed] ';
|
private const LOG_PREFIX = '[export_generation failed] ';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private LoggerInterface $logger,
|
private readonly LoggerInterface $logger,
|
||||||
private ExportGenerationRepository $repository,
|
private readonly ExportGenerationRepository $repository,
|
||||||
private EntityManagerInterface $entityManager,
|
private readonly EntityManagerInterface $entityManager,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public static function getSubscribedEvents()
|
public static function getSubscribedEvents()
|
||||||
@ -58,7 +58,7 @@ class OnExportGenerationFails implements EventSubscriberInterface
|
|||||||
'alias' => $exportGeneration->getExportAlias(),
|
'alias' => $exportGeneration->getExportAlias(),
|
||||||
'throwable_message' => $event->getThrowable()->getMessage(),
|
'throwable_message' => $event->getThrowable()->getMessage(),
|
||||||
'throwable_trace' => $event->getThrowable()->getTraceAsString(),
|
'throwable_trace' => $event->getThrowable()->getTraceAsString(),
|
||||||
'throwable' => get_class($event->getThrowable()),
|
'throwable' => $event->getThrowable()::class,
|
||||||
'full_generation_duration_failure' => microtime(true) - $exportGeneration->getCreatedAt()->getTimestamp(),
|
'full_generation_duration_failure' => microtime(true) - $exportGeneration->getCreatedAt()->getTimestamp(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user