Refactor callback functions to arrow functions

The callback functions used in the addViewTransformer method in FilterType.php and AggregatorType.php were replaced with shorter arrow functions. This change was made to increase code readability and encourage consistency throughout the codebase.
This commit is contained in:
Julien Fastré 2024-06-17 17:29:16 +02:00
parent 19e34d5dc0
commit 1f4bef754d
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
3 changed files with 3 additions and 7 deletions

View File

@ -42,9 +42,7 @@ class AggregatorType extends AbstractType
if ($aggregator instanceof DataTransformerInterface) {
$aggregatorFormBuilder->addViewTransformer(new CallbackTransformer(
fn (?array $data) => $data,
function (?array $data) use ($aggregator) {
return $aggregator->transformData($data);
},
fn (?array $data) => $aggregator->transformData($data),
));
}

View File

@ -48,9 +48,7 @@ class FilterType extends AbstractType
if ($filter instanceof DataTransformerInterface) {
$filterFormBuilder->addViewTransformer(new CallbackTransformer(
fn (?array $data) => $data,
function (?array $data) use ($filter) {
return $filter->transformData($data);
},
fn (?array $data) => $filter->transformData($data),
));
}

View File

@ -41,7 +41,7 @@ final class ChillReportExtensionTest extends KernelTestCase
}
if (!$reportFounded) {
throw new \Exception('Class Chill\\ReportBundle\\Entity\\Report not found in chill_custom_fields.customizables_entities', 1);
throw new \Exception('Class Chill\ReportBundle\Entity\Report not found in chill_custom_fields.customizables_entities', 1);
}
}
}