Apply rector rules + fix CS

This commit is contained in:
2023-08-30 14:55:26 +02:00
parent d01172274d
commit 1c0fd57913
26 changed files with 50 additions and 76 deletions

View File

@@ -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];