diff --git a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php index 9c436524d..5d20d3575 100644 --- a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php +++ b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php @@ -151,6 +151,7 @@ final class CalendarContext implements CalendarContextInterface /** * param array{mainPerson?: Person, thirdParty?: ThirdParty, title: string} $contextGenerationData + * @param mixed $entity */ public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array { diff --git a/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php b/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php index 6f153acd8..4e89861dd 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php +++ b/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php @@ -257,7 +257,8 @@ final class DocGeneratorTemplateController extends AbstractController return $this->render('@ChillDocGenerator/Generator/debug_value.html.twig', [ 'datas' => json_encode($context->getData($template, $entity, $contextGenerationData), JSON_PRETTY_PRINT) ]); - } elseif ($isTest) { + } + if ($isTest) { $generated = $this->generator->generateDocFromTemplate( $template, $entityId, @@ -283,7 +284,7 @@ final class DocGeneratorTemplateController extends AbstractController // we prepare the object to store the document $storedObject = (new StoredObject()) ->setStatus(StoredObject::STATUS_PENDING) - ; + ; $this->entityManager->persist($storedObject); diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php index 394f8148b..624bf2435 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php @@ -1,5 +1,14 @@ entityManager ->find($context->getEntityClass(), $entityId) - ; + ; if (null === $entity) { throw new RelatedEntityNotFoundException($template->getEntity(), $entityId); @@ -80,9 +89,9 @@ class Generator implements GeneratorInterface $contextGenerationDataNormalized = array_merge( $contextGenerationDataNormalized, - $context instanceof DocGeneratorContextWithPublicFormInterface ? - $context->contextGenerationDataDenormalize($template, $entity, $contextGenerationDataNormalized) - : [] + $context instanceof DocGeneratorContextWithPublicFormInterface ? + $context->contextGenerationDataDenormalize($template, $entity, $contextGenerationDataNormalized) + : [] ); $data = $context->getData($template, $entity, $contextGenerationDataNormalized); @@ -127,7 +136,7 @@ class Generator implements GeneratorInterface ->setType($template->getFile()->getType()) ->setFilename(sprintf('%s_odt', uniqid('doc_', true))) ->setStatus(StoredObject::STATUS_READY) - ; + ; $this->storedObjectManager->write($destinationStoredObject, $generatedResource); diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorException.php b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorException.php index 0f3412859..2124ee420 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorException.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorException.php @@ -1,5 +1,14 @@ errors = $errors; - parent::__construct("Could not generate the document", 15252, - $previous); + parent::__construct( + "Could not generate the document", + 15252, + $previous + ); } /** diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorInterface.php b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorInterface.php index 385e1d010..fc2f0e2f9 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorInterface.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorInterface.php @@ -1,5 +1,14 @@ getProperty('id')->setAccessible(true); $reflection->getProperty('id')->setValue($destinationStoredObject, 1); - $entity = new class {}; + $entity = new class () {}; $data = []; $context = $this->prophesize(DocGeneratorContextInterface::class); diff --git a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php index 29b978ffb..a11556e42 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php @@ -1,5 +1,14 @@ engine ->render('@ChillWopi/Editor/stored_object_failure.html.twig') ); - } elseif (StoredObject::STATUS_PENDING === $storedObject->getStatus()) { + } + if (StoredObject::STATUS_PENDING === $storedObject->getStatus()) { return new Response( $this->engine ->render('@ChillWopi/Editor/stored_object_pending.html.twig', [