Merge remote-tracking branch 'origin/master' into features/docgen-widget-generate-template

This commit is contained in:
2021-11-30 16:38:36 +01:00
1055 changed files with 5050 additions and 2165 deletions

View File

@@ -7,6 +7,8 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\DocGeneratorBundle\Controller;
use ChampsLibres\AsyncUploaderBundle\TempUrl\TempUrlGeneratorInterface;
@@ -66,7 +68,7 @@ class DocGeneratorTemplateController extends AbstractController
$entity = $this->getDoctrine()->getRepository($entityClassName)->find($entityId);
if ($template->getContext() == HouseholdMemberSelectionContext::class) {
if ($template->getContext() === HouseholdMemberSelectionContext::class) {
$context = new HouseholdMemberSelectionContext();
$datas = $context->getData($entity);
} else {
@@ -88,9 +90,9 @@ class DocGeneratorTemplateController extends AbstractController
unlink($tmpfname);
$fileContent = fopen($tmpfname2, 'r'); // the generated file content
$fileContent = fopen($tmpfname2, 'rb'); // the generated file content
$genDocName = 'doc_' . sprintf('%010d', rand()) . '.docx';
$genDocName = 'doc_' . sprintf('%010d', mt_rand()) . '.docx';
$getUrlGen = $tempUrlGenerator->generate(
'PUT',
@@ -106,7 +108,7 @@ class DocGeneratorTemplateController extends AbstractController
'body' => $fileContent,
]);
if ($putResponse->getStatusCode() == 201) {
if ($putResponse->getStatusCode() === 201) {
$em = $this->getDoctrine()->getManager();
$storedObject = new StoredObject();
$storedObject