Apply rector rules + fix CS

This commit is contained in:
Julien Fastré 2023-08-30 14:55:26 +02:00
parent d01172274d
commit 1c0fd57913
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
26 changed files with 50 additions and 76 deletions

View File

@ -138,7 +138,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
return 'circle'; return 'circle';
} }
return $this->translatableStringHelper->localize(json_decode($value, true, 512, JSON_THROW_ON_ERROR)); return $this->translatableStringHelper->localize(json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR));
}; };
case 'type_name': case 'type_name':
@ -147,7 +147,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
return 'activity type'; return 'activity type';
} }
return $this->translatableStringHelper->localize(json_decode($value, true, 512, JSON_THROW_ON_ERROR)); return $this->translatableStringHelper->localize(json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR));
}; };
default: default:

View File

@ -125,7 +125,7 @@ class ListActivityHelper
}; };
} }
$decoded = json_decode($value, null, 512, JSON_THROW_ON_ERROR); $decoded = json_decode((string) $value, null, 512, JSON_THROW_ON_ERROR);
return implode( return implode(
'|', '|',

View File

@ -468,9 +468,8 @@ class ParticipationController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/event/participation/{event_id}/update_multiple", name="chill_event_participation_update_multiple", methods={"POST"}) * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/event/participation/{event_id}/update_multiple", name="chill_event_participation_update_multiple", methods={"POST"})
* @param mixed $event_id
*/ */
public function updateMultipleAction($event_id, Request $request) public function updateMultipleAction(mixed $event_id, Request $request)
{ {
/** @var \Chill\EventBundle\Entity\Event $event */ /** @var \Chill\EventBundle\Entity\Event $event */
$event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class) $event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class)

View File

@ -318,7 +318,7 @@ class ChillImportUsersCommand extends Command
return ''; return '';
} }
return trim($value); return trim((string) $value);
}); });
$helper = $this->getHelper('question'); $helper = $this->getHelper('question');

View File

@ -68,9 +68,8 @@ class ExportController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/exports/download/{alias}", name="chill_main_export_download", methods={"GET"}) * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/exports/download/{alias}", name="chill_main_export_download", methods={"GET"})
* @param mixed $alias
*/ */
public function downloadResultAction(Request $request, $alias) public function downloadResultAction(Request $request, mixed $alias)
{ {
/** @var \Chill\MainBundle\Export\ExportManager $exportManager */ /** @var \Chill\MainBundle\Export\ExportManager $exportManager */
$exportManager = $this->exportManager; $exportManager = $this->exportManager;

View File

@ -42,9 +42,8 @@ class SearchController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/search/advanced/{name}", name="chill_main_advanced_search") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/search/advanced/{name}", name="chill_main_advanced_search")
* @param mixed $name
*/ */
public function advancedSearchAction($name, Request $request) public function advancedSearchAction(mixed $name, Request $request)
{ {
try { try {
/** @var Chill\MainBundle\Search\SearchProvider $variable */ /** @var Chill\MainBundle\Search\SearchProvider $variable */
@ -110,9 +109,8 @@ class SearchController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/search.{_format}", name="chill_main_search", requirements={"_format"="html|json"}, defaults={"_format"="html"}) * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/search.{_format}", name="chill_main_search", requirements={"_format"="html|json"}, defaults={"_format"="html"})
* @param mixed $_format
*/ */
public function searchAction(Request $request, $_format) public function searchAction(Request $request, mixed $_format)
{ {
$pattern = trim((string) $request->query->get('q', '')); $pattern = trim((string) $request->query->get('q', ''));
@ -203,9 +201,8 @@ class SearchController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/api/1.0/search.{_format}", name="chill_main_search_global", requirements={"_format"="json"}, defaults={"_format"="json"}) * @\Symfony\Component\Routing\Annotation\Route(path="/api/1.0/search.{_format}", name="chill_main_search_global", requirements={"_format"="json"}, defaults={"_format"="json"})
* @param mixed $_format
*/ */
public function searchApi(Request $request, $_format): JsonResponse public function searchApi(Request $request, mixed $_format): JsonResponse
{ {
//TODO this is an incomplete implementation //TODO this is an incomplete implementation
$query = $request->query->get('q', ''); $query = $request->query->get('q', '');

View File

@ -29,7 +29,7 @@ class AggregateStringHelper
return implode( return implode(
'|', '|',
json_decode($value, true, 512, JSON_THROW_ON_ERROR) json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR)
); );
}; };
} }

View File

@ -292,7 +292,7 @@ class ExportAddressHelper
return ''; return '';
} }
return $this->translatableStringHelper->localize(json_decode($value, true, 512, JSON_THROW_ON_ERROR)); return $this->translatableStringHelper->localize(json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR));
}; };
case 'isNoAddress': case 'isNoAddress':
@ -351,7 +351,7 @@ class ExportAddressHelper
return ''; return '';
} }
$decodedValues = json_decode($value, true, 512, JSON_THROW_ON_ERROR); $decodedValues = json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR);
return match (count($decodedValues)) { return match (count($decodedValues)) {
0 => '', 0 => '',

View File

@ -36,7 +36,7 @@ class TranslatableStringExportLabelHelper
return ''; return '';
} }
return $this->translatableStringHelper->localize(json_decode($value, true, 512, JSON_THROW_ON_ERROR)); return $this->translatableStringHelper->localize(json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR));
}; };
} }
@ -51,7 +51,7 @@ class TranslatableStringExportLabelHelper
return ''; return '';
} }
$decoded = json_decode($value, true, 512, JSON_THROW_ON_ERROR); $decoded = json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR);
return implode( return implode(
'|', '|',

View File

@ -48,7 +48,7 @@ class UserHelper
return ''; return '';
} }
$decoded = json_decode($value, null, 512, JSON_THROW_ON_ERROR); $decoded = json_decode((string) $value, null, 512, JSON_THROW_ON_ERROR);
if (0 === count($decoded)) { if (0 === count($decoded)) {
return ''; return '';

View File

@ -42,9 +42,8 @@ class PersonAddressController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/create", name="chill_person_address_create", methods={"POST"}) * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/create", name="chill_person_address_create", methods={"POST"})
* @param mixed $person_id
*/ */
public function createAction($person_id, Request $request) public function createAction(mixed $person_id, Request $request)
{ {
$person = $this->getDoctrine()->getManager() $person = $this->getDoctrine()->getManager()
->getRepository(\Chill\PersonBundle\Entity\Person::class) ->getRepository(\Chill\PersonBundle\Entity\Person::class)
@ -101,10 +100,8 @@ class PersonAddressController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/{address_id}/edit", name="chill_person_address_edit") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/{address_id}/edit", name="chill_person_address_edit")
* @param mixed $person_id
* @param mixed $address_id
*/ */
public function editAction($person_id, $address_id) public function editAction(mixed $person_id, mixed $address_id)
{ {
$person = $this->getDoctrine()->getManager() $person = $this->getDoctrine()->getManager()
->getRepository(\Chill\PersonBundle\Entity\Person::class) ->getRepository(\Chill\PersonBundle\Entity\Person::class)
@ -134,9 +131,8 @@ class PersonAddressController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/list", name="chill_person_address_list") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/list", name="chill_person_address_list")
* @param mixed $person_id
*/ */
public function listAction($person_id) public function listAction(mixed $person_id)
{ {
$person = $this->getDoctrine()->getManager() $person = $this->getDoctrine()->getManager()
->getRepository(\Chill\PersonBundle\Entity\Person::class) ->getRepository(\Chill\PersonBundle\Entity\Person::class)
@ -160,9 +156,8 @@ class PersonAddressController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/new", name="chill_person_address_new") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/new", name="chill_person_address_new")
* @param mixed $person_id
*/ */
public function newAction($person_id) public function newAction(mixed $person_id)
{ {
$person = $this->getDoctrine()->getManager() $person = $this->getDoctrine()->getManager()
->getRepository(\Chill\PersonBundle\Entity\Person::class) ->getRepository(\Chill\PersonBundle\Entity\Person::class)
@ -191,10 +186,8 @@ class PersonAddressController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/{address_id}/update", name="chill_person_address_update") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/{address_id}/update", name="chill_person_address_update")
* @param mixed $person_id
* @param mixed $address_id
*/ */
public function updateAction($person_id, $address_id, Request $request) public function updateAction(mixed $person_id, mixed $address_id, Request $request)
{ {
$person = $this->getDoctrine()->getManager() $person = $this->getDoctrine()->getManager()
->getRepository(\Chill\PersonBundle\Entity\Person::class) ->getRepository(\Chill\PersonBundle\Entity\Person::class)

View File

@ -40,10 +40,8 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/confirm", name="chill_person_duplicate_confirm") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/confirm", name="chill_person_duplicate_confirm")
* @param mixed $person1_id
* @param mixed $person2_id
*/ */
public function confirmAction($person1_id, $person2_id, Request $request) public function confirmAction(mixed $person1_id, mixed $person2_id, Request $request)
{ {
if ($person1_id === $person2_id) { if ($person1_id === $person2_id) {
throw new InvalidArgumentException('Can not merge same person'); throw new InvalidArgumentException('Can not merge same person');
@ -106,9 +104,8 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/find-manually", name="chill_person_find_manually_duplicate") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/find-manually", name="chill_person_find_manually_duplicate")
* @param mixed $person_id
*/ */
public function findManuallyDuplicateAction($person_id, Request $request) public function findManuallyDuplicateAction(mixed $person_id, Request $request)
{ {
$person = $this->_getPerson($person_id); $person = $this->_getPerson($person_id);
@ -160,10 +157,8 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/not-duplicate", name="chill_person_duplicate_not_duplicate") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/not-duplicate", name="chill_person_duplicate_not_duplicate")
* @param mixed $person1_id
* @param mixed $person2_id
*/ */
public function notDuplicateAction($person1_id, $person2_id) public function notDuplicateAction(mixed $person1_id, mixed $person2_id)
{ {
[$person1, $person2] = $this->_getPersonsByPriority($person1_id, $person2_id); [$person1, $person2] = $this->_getPersonsByPriority($person1_id, $person2_id);
@ -191,10 +186,8 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/remove-not-duplicate", name="chill_person_remove_duplicate_not_duplicate") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/remove-not-duplicate", name="chill_person_remove_duplicate_not_duplicate")
* @param mixed $person1_id
* @param mixed $person2_id
*/ */
public function removeNotDuplicateAction($person1_id, $person2_id) public function removeNotDuplicateAction(mixed $person1_id, mixed $person2_id)
{ {
[$person1, $person2] = $this->_getPersonsByPriority($person1_id, $person2_id); [$person1, $person2] = $this->_getPersonsByPriority($person1_id, $person2_id);
@ -217,9 +210,8 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/duplicate/view", name="chill_person_duplicate_view") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/duplicate/view", name="chill_person_duplicate_view")
* @param mixed $person_id
*/ */
public function viewAction($person_id, PersonNotDuplicateRepository $personNotDuplicateRepository) public function viewAction(mixed $person_id, PersonNotDuplicateRepository $personNotDuplicateRepository)
{ {
$person = $this->_getPerson($person_id); $person = $this->_getPerson($person_id);

View File

@ -31,10 +31,8 @@ final class PersonResourceController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/{resource_id}/delete", name="chill_person_resource_delete") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/{resource_id}/delete", name="chill_person_resource_delete")
* @param mixed $person_id
* @param mixed $resource_id
*/ */
public function deleteAction(Request $request, $person_id, $resource_id): Response public function deleteAction(Request $request, mixed $person_id, mixed $resource_id): Response
{ {
$personOwner = $this->personRepository->find($person_id); $personOwner = $this->personRepository->find($person_id);
$resource = $this->personResourceRepository->find($resource_id); $resource = $this->personResourceRepository->find($resource_id);
@ -82,10 +80,8 @@ final class PersonResourceController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/{resource_id}/edit", name="chill_person_resource_edit") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/{resource_id}/edit", name="chill_person_resource_edit")
* @param mixed $resource_id
* @param mixed $person_id
*/ */
public function editAction(Request $request, $resource_id, $person_id): Response public function editAction(Request $request, mixed $resource_id, mixed $person_id): Response
{ {
$resource = $this->personResourceRepository->find($resource_id); $resource = $this->personResourceRepository->find($resource_id);
$personOwner = $this->personRepository->find($person_id); $personOwner = $this->personRepository->find($person_id);
@ -121,9 +117,8 @@ final class PersonResourceController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/list", name="chill_person_resource_list") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/list", name="chill_person_resource_list")
* @param mixed $person_id
*/ */
public function listAction(Request $request, $person_id) public function listAction(Request $request, mixed $person_id)
{ {
$personOwner = $this->personRepository->find($person_id); $personOwner = $this->personRepository->find($person_id);
$this->denyAccessUnlessGranted(PersonVoter::SEE, $personOwner); $this->denyAccessUnlessGranted(PersonVoter::SEE, $personOwner);
@ -142,9 +137,8 @@ final class PersonResourceController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/new", name="chill_person_resource_new") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/new", name="chill_person_resource_new")
* @param mixed $person_id
*/ */
public function newAction(Request $request, $person_id) public function newAction(Request $request, mixed $person_id)
{ {
$personOwner = $this->personRepository->find($person_id); $personOwner = $this->personRepository->find($person_id);
$personResource = new PersonResource(); $personResource = new PersonResource();

View File

@ -28,9 +28,8 @@ class TimelinePersonController extends AbstractController
/** /**
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/timeline", name="chill_person_timeline") * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/timeline", name="chill_person_timeline")
* @param mixed $person_id
*/ */
public function personAction(Request $request, $person_id) public function personAction(Request $request, mixed $person_id)
{ {
$person = $this->getDoctrine() $person = $this->getDoctrine()
->getRepository(Person::class) ->getRepository(Person::class)

View File

@ -320,7 +320,7 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface, Grou
return $this->customFieldProvider return $this->customFieldProvider
->getCustomFieldByType($cf->getType()) ->getCustomFieldByType($cf->getType())
->render(json_decode($value, true, 512, JSON_THROW_ON_ERROR), $cf, 'csv'); ->render(json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR), $cf, 'csv');
}; };
if ($cfType instanceof CustomFieldChoice && $cfType->isMultiple($cf)) { if ($cfType instanceof CustomFieldChoice && $cfType->isMultiple($cf)) {
@ -330,7 +330,7 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface, Grou
if (null === $value) { if (null === $value) {
return ''; return '';
} }
$decoded = json_decode($value, true, 512, JSON_THROW_ON_ERROR); $decoded = json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR);
if ('_header' === $value) { if ('_header' === $value) {
$label = $cfType->getChoices($cf)[$slugChoice]; $label = $cfType->getChoices($cf)[$slugChoice];

View File

@ -33,7 +33,7 @@ class LabelPersonHelper
return ''; return '';
} }
$decoded = json_decode($value, null, 512, JSON_THROW_ON_ERROR); $decoded = json_decode((string) $value, null, 512, JSON_THROW_ON_ERROR);
if (0 === count($decoded)) { if (0 === count($decoded)) {
return ''; return '';

View File

@ -103,7 +103,7 @@ final readonly class ListAccompanyingPeriodHelper
return ''; return '';
} }
return $this->translatableStringHelper->localize(json_decode($value, true, 512, JSON_THROW_ON_ERROR)); return $this->translatableStringHelper->localize(json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR));
}, },
'locationPersonName', 'requestorPerson' => function ($value) use ($key) { 'locationPersonName', 'requestorPerson' => function ($value) use ($key) {
if ('_header' === $value) { if ('_header' === $value) {
@ -140,7 +140,7 @@ final readonly class ListAccompanyingPeriodHelper
'|', '|',
array_map( array_map(
fn ($s) => $this->translatableStringHelper->localize($s), fn ($s) => $this->translatableStringHelper->localize($s),
json_decode($value, true, 512, JSON_THROW_ON_ERROR) json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR)
) )
); );
}, },
@ -157,7 +157,7 @@ final readonly class ListAccompanyingPeriodHelper
'|', '|',
array_map( array_map(
fn ($s) => $this->socialIssueRender->renderString($this->socialIssueRepository->find($s), []), fn ($s) => $this->socialIssueRender->renderString($this->socialIssueRepository->find($s), []),
json_decode($value, true, 512, JSON_THROW_ON_ERROR) json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR)
) )
); );
}, },

View File

@ -332,7 +332,7 @@ class ListPersonHelper
return ''; return '';
} }
$ids = json_decode($value, null, 512, JSON_THROW_ON_ERROR); $ids = json_decode((string) $value, null, 512, JSON_THROW_ON_ERROR);
return return
implode( implode(

View File

@ -57,7 +57,7 @@ final class PersonControllerUpdateTest extends WebTestCase
$em = self::$container->get(EntityManagerInterface::class); $em = self::$container->get(EntityManagerInterface::class);
foreach (self::$toDelete as list($class, $id)) { foreach (self::$toDelete as [$class, $id]) {
$entity = $em->find($class, $id); $entity = $em->find($class, $id);
if (null === $entity) { if (null === $entity) {

View File

@ -41,7 +41,7 @@ final class PersonControllerViewTest extends WebTestCase
$em = self::$container->get(EntityManagerInterface::class); $em = self::$container->get(EntityManagerInterface::class);
foreach (self::$toDelete as list($class, $id)) { foreach (self::$toDelete as [$class, $id]) {
$entity = $em->find($class, $id); $entity = $em->find($class, $id);
if (null === $entity) { if (null === $entity) {
@ -85,7 +85,8 @@ final class PersonControllerViewTest extends WebTestCase
$client->request('GET', $this->makeViewPath($personId)); $client->request('GET', $this->makeViewPath($personId));
self::assertResponseStatusCodeSame(403, self::assertResponseStatusCodeSame(
403,
'The view page of a person of a center A must not be accessible for user of center B' 'The view page of a person of a center A must not be accessible for user of center B'
); );
} }

View File

@ -27,7 +27,7 @@ final class PersonControllerViewWithHiddenFieldsTest extends WebTestCase
/** /**
* @var string The url to view the person details * @var string The url to view the person details
*/ */
private string $viewUrl; private readonly string $viewUrl;
protected function setUp(): void protected function setUp(): void
{ {

View File

@ -26,7 +26,7 @@ use function is_object;
class BirthdateValidator extends ConstraintValidator class BirthdateValidator extends ConstraintValidator
{ {
private string $interval_spec; private readonly string $interval_spec;
private string $below_interval = 'P150Y'; private string $below_interval = 'P150Y';

View File

@ -81,7 +81,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface
'label' => 'Fields to include in export', 'label' => 'Fields to include in export',
'choice_attr' => static function ($val, $key, $index) { 'choice_attr' => static function ($val, $key, $index) {
// add a 'data-display-target' for address fields // add a 'data-display-target' for address fields
if (str_starts_with($val, 'address_')) { if (str_starts_with((string) $val, 'address_')) {
return ['data-display-target' => 'address_date']; return ['data-display-target' => 'address_date'];
} }
@ -250,7 +250,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface
return ''; return '';
} }
return $this->translatableStringHelper->localize(json_decode($value, true, 512, JSON_THROW_ON_ERROR)); return $this->translatableStringHelper->localize(json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR));
}; };
default: default:
@ -488,13 +488,13 @@ class ReportList implements ExportElementValidatedInterface, ListInterface
return $this->customFieldProvider return $this->customFieldProvider
->getCustomFieldByType($cf->getType()) ->getCustomFieldByType($cf->getType())
->render(json_decode($value, true, 512, JSON_THROW_ON_ERROR), $cf, 'csv'); ->render(json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR), $cf, 'csv');
}; };
if ($cfType instanceof CustomFieldChoice && $cfType->isMultiple($cf)) { if ($cfType instanceof CustomFieldChoice && $cfType->isMultiple($cf)) {
return function ($value) use ($cf, $cfType, $key) { return function ($value) use ($cf, $cfType, $key) {
$slugChoice = $this->extractInfosFromSlug($key)['additionnalInfos']['choiceSlug']; $slugChoice = $this->extractInfosFromSlug($key)['additionnalInfos']['choiceSlug'];
$decoded = json_decode($value, true, 512, JSON_THROW_ON_ERROR); $decoded = json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR);
if ('_header' === $value) { if ('_header' === $value) {
$label = $cfType->getChoices($cf)[$slugChoice]; $label = $cfType->getChoices($cf)[$slugChoice];

View File

@ -48,7 +48,7 @@ class LabelThirdPartyHelper
return ''; return '';
} }
$decoded = json_decode($value, null, 512, JSON_THROW_ON_ERROR); $decoded = json_decode((string) $value, null, 512, JSON_THROW_ON_ERROR);
if (0 === count($decoded)) { if (0 === count($decoded)) {
return ''; return '';

View File

@ -28,7 +28,7 @@ class ChillDocumentLockManager implements DocumentLockManagerInterface
public function __construct( public function __construct(
private readonly ChillRedis $redis, private readonly ChillRedis $redis,
private int $ttlAfterDeleteSeconds = self::LOCK_GRACEFUL_DURATION_TIME private readonly int $ttlAfterDeleteSeconds = self::LOCK_GRACEFUL_DURATION_TIME
) { ) {
} }