mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 13:54:59 +00:00
Add explicit return types and TranslatableInterface support
Updated interfaces to include explicit return types for improved type safety and readability. Integrated support for Symfony's TranslatableInterface in relevant methods to enhance translation handling.
This commit is contained in:
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\MainBundle\Export;
|
||||
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Contracts\Translation\TranslatableInterface;
|
||||
|
||||
/**
|
||||
* @method generate($result, $formatterData, string $exportAlias, array $exportData, array $filtersData, array $aggregatorsData): FormattedExportGeneration
|
||||
@@ -33,16 +34,16 @@ interface FormatterInterface
|
||||
*/
|
||||
public function buildForm(
|
||||
FormBuilderInterface $builder,
|
||||
$exportAlias,
|
||||
string $exportAlias,
|
||||
array $aggregatorAliases,
|
||||
);
|
||||
): void;
|
||||
|
||||
/**
|
||||
* get the default data for the form build by buildForm.
|
||||
*/
|
||||
public function getFormDefaultData(array $aggregatorAliases): array;
|
||||
|
||||
public function getName();
|
||||
public function getName(): string|TranslatableInterface;
|
||||
|
||||
/**
|
||||
* Generate a response from the data collected on differents ExportElementInterface.
|
||||
@@ -54,6 +55,8 @@ interface FormatterInterface
|
||||
* @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response The response to be shown
|
||||
*
|
||||
* @deprecated use generate instead
|
||||
*/
|
||||
public function getResponse(
|
||||
$result,
|
||||
@@ -64,7 +67,7 @@ interface FormatterInterface
|
||||
array $aggregatorsData,
|
||||
);
|
||||
|
||||
public function getType();
|
||||
public function getType(): string;
|
||||
|
||||
public function normalizeFormData(array $formData): array;
|
||||
|
||||
|
Reference in New Issue
Block a user