mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 09:18:24 +00:00 
			
		
		
		
	Apply rector rules + fix CS
This commit is contained in:
		| @@ -138,7 +138,7 @@ class ListActivity implements ListInterface, GroupedExportInterface | ||||
|                         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': | ||||
| @@ -147,7 +147,7 @@ class ListActivity implements ListInterface, GroupedExportInterface | ||||
|                         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: | ||||
|   | ||||
| @@ -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( | ||||
|                     '|', | ||||
|   | ||||
| @@ -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"}) | ||||
|      * @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 */ | ||||
|         $event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class) | ||||
|   | ||||
| @@ -318,7 +318,7 @@ class ChillImportUsersCommand extends Command | ||||
|                     return ''; | ||||
|                 } | ||||
|  | ||||
|                 return trim($value); | ||||
|                 return trim((string) $value); | ||||
|             }); | ||||
|         $helper = $this->getHelper('question'); | ||||
|  | ||||
|   | ||||
| @@ -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"}) | ||||
|      * @param mixed $alias | ||||
|      */ | ||||
|     public function downloadResultAction(Request $request, $alias) | ||||
|     public function downloadResultAction(Request $request, mixed $alias) | ||||
|     { | ||||
|         /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ | ||||
|         $exportManager = $this->exportManager; | ||||
|   | ||||
| @@ -42,9 +42,8 @@ class SearchController extends AbstractController | ||||
|  | ||||
|     /** | ||||
|      * @\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 { | ||||
|             /** @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"}) | ||||
|      * @param mixed $_format | ||||
|      */ | ||||
|     public function searchAction(Request $request, $_format) | ||||
|     public function searchAction(Request $request, mixed $_format) | ||||
|     { | ||||
|         $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"}) | ||||
|      * @param mixed $_format | ||||
|      */ | ||||
|     public function searchApi(Request $request, $_format): JsonResponse | ||||
|     public function searchApi(Request $request, mixed $_format): JsonResponse | ||||
|     { | ||||
|         //TODO this is an incomplete implementation | ||||
|         $query = $request->query->get('q', ''); | ||||
|   | ||||
| @@ -29,7 +29,7 @@ class AggregateStringHelper | ||||
|  | ||||
|             return implode( | ||||
|                 '|', | ||||
|                 json_decode($value, true, 512, JSON_THROW_ON_ERROR) | ||||
|                 json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR) | ||||
|             ); | ||||
|         }; | ||||
|     } | ||||
|   | ||||
| @@ -292,7 +292,7 @@ class ExportAddressHelper | ||||
|                         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': | ||||
| @@ -351,7 +351,7 @@ class ExportAddressHelper | ||||
|                             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)) { | ||||
|                             0 => '', | ||||
|   | ||||
| @@ -36,7 +36,7 @@ class TranslatableStringExportLabelHelper | ||||
|                 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 ''; | ||||
|             } | ||||
|  | ||||
|             $decoded = json_decode($value, true, 512, JSON_THROW_ON_ERROR); | ||||
|             $decoded = json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR); | ||||
|  | ||||
|             return implode( | ||||
|                 '|', | ||||
|   | ||||
| @@ -48,7 +48,7 @@ class UserHelper | ||||
|                 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)) { | ||||
|                 return ''; | ||||
|   | ||||
| @@ -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"}) | ||||
|      * @param mixed $person_id | ||||
|      */ | ||||
|     public function createAction($person_id, Request $request) | ||||
|     public function createAction(mixed $person_id, Request $request) | ||||
|     { | ||||
|         $person = $this->getDoctrine()->getManager() | ||||
|             ->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") | ||||
|      * @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() | ||||
|             ->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") | ||||
|      * @param mixed $person_id | ||||
|      */ | ||||
|     public function listAction($person_id) | ||||
|     public function listAction(mixed $person_id) | ||||
|     { | ||||
|         $person = $this->getDoctrine()->getManager() | ||||
|             ->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") | ||||
|      * @param mixed $person_id | ||||
|      */ | ||||
|     public function newAction($person_id) | ||||
|     public function newAction(mixed $person_id) | ||||
|     { | ||||
|         $person = $this->getDoctrine()->getManager() | ||||
|             ->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") | ||||
|      * @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() | ||||
|             ->getRepository(\Chill\PersonBundle\Entity\Person::class) | ||||
|   | ||||
| @@ -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") | ||||
|      * @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) { | ||||
|             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") | ||||
|      * @param mixed $person_id | ||||
|      */ | ||||
|     public function findManuallyDuplicateAction($person_id, Request $request) | ||||
|     public function findManuallyDuplicateAction(mixed $person_id, Request $request) | ||||
|     { | ||||
|         $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") | ||||
|      * @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); | ||||
|  | ||||
| @@ -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") | ||||
|      * @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); | ||||
|  | ||||
| @@ -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") | ||||
|      * @param mixed $person_id | ||||
|      */ | ||||
|     public function viewAction($person_id, PersonNotDuplicateRepository $personNotDuplicateRepository) | ||||
|     public function viewAction(mixed $person_id, PersonNotDuplicateRepository $personNotDuplicateRepository) | ||||
|     { | ||||
|         $person = $this->_getPerson($person_id); | ||||
|  | ||||
|   | ||||
| @@ -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") | ||||
|      * @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); | ||||
|         $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") | ||||
|      * @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); | ||||
|         $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") | ||||
|      * @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); | ||||
|         $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") | ||||
|      * @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); | ||||
|         $personResource = new PersonResource(); | ||||
|   | ||||
| @@ -28,9 +28,8 @@ class TimelinePersonController extends AbstractController | ||||
|  | ||||
|     /** | ||||
|      * @\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() | ||||
|             ->getRepository(Person::class) | ||||
|   | ||||
| @@ -320,7 +320,7 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface, Grou | ||||
|  | ||||
|             return $this->customFieldProvider | ||||
|                 ->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)) { | ||||
| @@ -330,7 +330,7 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface, Grou | ||||
|                 if (null === $value) { | ||||
|                     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) { | ||||
|                     $label = $cfType->getChoices($cf)[$slugChoice]; | ||||
|   | ||||
| @@ -33,7 +33,7 @@ class LabelPersonHelper | ||||
|                 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)) { | ||||
|                 return ''; | ||||
|   | ||||
| @@ -103,7 +103,7 @@ final readonly class ListAccompanyingPeriodHelper | ||||
|                     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) { | ||||
|                 if ('_header' === $value) { | ||||
| @@ -140,7 +140,7 @@ final readonly class ListAccompanyingPeriodHelper | ||||
|                     '|', | ||||
|                     array_map( | ||||
|                         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( | ||||
|                         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) | ||||
|                     ) | ||||
|                 ); | ||||
|             }, | ||||
|   | ||||
| @@ -332,7 +332,7 @@ class ListPersonHelper | ||||
|                         return ''; | ||||
|                     } | ||||
|  | ||||
|                     $ids = json_decode($value, null, 512, JSON_THROW_ON_ERROR); | ||||
|                     $ids = json_decode((string) $value, null, 512, JSON_THROW_ON_ERROR); | ||||
|  | ||||
|                     return | ||||
|                         implode( | ||||
|   | ||||
| @@ -57,7 +57,7 @@ final class PersonControllerUpdateTest extends WebTestCase | ||||
|  | ||||
|         $em = self::$container->get(EntityManagerInterface::class); | ||||
|  | ||||
|         foreach (self::$toDelete as list($class, $id)) { | ||||
|         foreach (self::$toDelete as [$class, $id]) { | ||||
|             $entity = $em->find($class, $id); | ||||
|  | ||||
|             if (null === $entity) { | ||||
|   | ||||
| @@ -41,7 +41,7 @@ final class PersonControllerViewTest extends WebTestCase | ||||
|  | ||||
|         $em = self::$container->get(EntityManagerInterface::class); | ||||
|  | ||||
|         foreach (self::$toDelete as list($class, $id)) { | ||||
|         foreach (self::$toDelete as [$class, $id]) { | ||||
|             $entity = $em->find($class, $id); | ||||
|  | ||||
|             if (null === $entity) { | ||||
| @@ -85,7 +85,8 @@ final class PersonControllerViewTest extends WebTestCase | ||||
|  | ||||
|         $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' | ||||
|         ); | ||||
|     } | ||||
|   | ||||
| @@ -27,7 +27,7 @@ final class PersonControllerViewWithHiddenFieldsTest extends WebTestCase | ||||
|     /** | ||||
|      * @var string The url to view the person details | ||||
|      */ | ||||
|     private string $viewUrl; | ||||
|     private readonly string $viewUrl; | ||||
|  | ||||
|     protected function setUp(): void | ||||
|     { | ||||
|   | ||||
| @@ -69,7 +69,7 @@ final class BirthdateValidatorTest extends ConstraintValidatorTestCase | ||||
|         return new BirthdateValidator( | ||||
|             new ParameterBag(['chill_person' => ['validation' => ['birthdate_not_after' => 'P1D']]]), | ||||
|             new MockClock(new \DateTimeImmutable('2023-08-30T14:12:00')) | ||||
|             ); | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     private function createConstraint() | ||||
|   | ||||
| @@ -26,7 +26,7 @@ use function is_object; | ||||
|  | ||||
| class BirthdateValidator extends ConstraintValidator | ||||
| { | ||||
|     private string $interval_spec; | ||||
|     private readonly string $interval_spec; | ||||
|  | ||||
|     private string $below_interval = 'P150Y'; | ||||
|  | ||||
|   | ||||
| @@ -81,7 +81,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface | ||||
|             'label' => 'Fields to include in export', | ||||
|             'choice_attr' => static function ($val, $key, $index) { | ||||
|                 // 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']; | ||||
|                 } | ||||
|  | ||||
| @@ -250,7 +250,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface | ||||
|                         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: | ||||
| @@ -488,13 +488,13 @@ class ReportList implements ExportElementValidatedInterface, ListInterface | ||||
|  | ||||
|             return $this->customFieldProvider | ||||
|                 ->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)) { | ||||
|             return function ($value) use ($cf, $cfType, $key) { | ||||
|                 $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) { | ||||
|                     $label = $cfType->getChoices($cf)[$slugChoice]; | ||||
|   | ||||
| @@ -48,7 +48,7 @@ class LabelThirdPartyHelper | ||||
|                 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)) { | ||||
|                 return ''; | ||||
|   | ||||
| @@ -28,7 +28,7 @@ class ChillDocumentLockManager implements DocumentLockManagerInterface | ||||
|  | ||||
|     public function __construct( | ||||
|         private readonly ChillRedis $redis, | ||||
|         private int $ttlAfterDeleteSeconds = self::LOCK_GRACEFUL_DURATION_TIME | ||||
|         private readonly int $ttlAfterDeleteSeconds = self::LOCK_GRACEFUL_DURATION_TIME | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user