Implements new return types

This commit is contained in:
2025-04-07 14:35:29 +02:00
parent 1c4ee37507
commit 8e952cc966
236 changed files with 693 additions and 693 deletions

View File

@@ -55,7 +55,7 @@ class CSVFormatter implements FormatterInterface, ExportManagerAwareInterface
/**
* @uses appendAggregatorForm
*/
public function buildForm(FormBuilderInterface $builder, $exportAlias, array $aggregatorAliases)
public function buildForm(FormBuilderInterface $builder, $exportAlias, array $aggregatorAliases): void
{
$aggregators = $this->getExportManager()->getAggregators($aggregatorAliases);
$nb = \count($aggregatorAliases);
@@ -118,7 +118,7 @@ class CSVFormatter implements FormatterInterface, ExportManagerAwareInterface
return $descriptions;
}
public function getName()
public function getName(): string|\Symfony\Contracts\Translation\TranslatableInterface
{
return 'Comma separated values (CSV)';
}
@@ -151,7 +151,7 @@ class CSVFormatter implements FormatterInterface, ExportManagerAwareInterface
return $response;
}
public function getType()
public function getType(): string
{
return 'tabular';
}

View File

@@ -67,7 +67,7 @@ class CSVListFormatter implements FormatterInterface, ExportManagerAwareInterfac
FormBuilderInterface $builder,
$exportAlias,
array $aggregatorAliases,
) {
): void {
$builder->add('numerotation', ChoiceType::class, [
'choices' => [
'yes' => true,
@@ -99,7 +99,7 @@ class CSVListFormatter implements FormatterInterface, ExportManagerAwareInterfac
return ['numerotation' => true];
}
public function getName()
public function getName(): string|\Symfony\Contracts\Translation\TranslatableInterface
{
return 'CSV vertical list';
}
@@ -163,7 +163,7 @@ class CSVListFormatter implements FormatterInterface, ExportManagerAwareInterfac
return $response;
}
public function getType()
public function getType(): string
{
return FormatterInterface::TYPE_LIST;
}

View File

@@ -64,7 +64,7 @@ class CSVPivotedListFormatter implements FormatterInterface, ExportManagerAwareI
FormBuilderInterface $builder,
$exportAlias,
array $aggregatorAliases,
) {
): void {
$builder->add('numerotation', ChoiceType::class, [
'choices' => [
'yes' => true,
@@ -97,7 +97,7 @@ class CSVPivotedListFormatter implements FormatterInterface, ExportManagerAwareI
return ['numerotation' => true];
}
public function getName()
public function getName(): string|\Symfony\Contracts\Translation\TranslatableInterface
{
return 'CSV horizontal list';
}
@@ -165,7 +165,7 @@ class CSVPivotedListFormatter implements FormatterInterface, ExportManagerAwareI
return $response;
}
public function getType()
public function getType(): string
{
return FormatterInterface::TYPE_LIST;
}

View File

@@ -119,7 +119,7 @@ class SpreadSheetFormatter implements FormatterInterface, ExportManagerAwareInte
FormBuilderInterface $builder,
$exportAlias,
array $aggregatorAliases,
) {
): void {
// choosing between formats
$builder->add('format', ChoiceType::class, [
'choices' => [
@@ -215,7 +215,7 @@ class SpreadSheetFormatter implements FormatterInterface, ExportManagerAwareInte
return $response;
}
public function getType()
public function getType(): string
{
return 'tabular';
}

View File

@@ -67,7 +67,7 @@ class SpreadsheetListFormatter implements FormatterInterface, ExportManagerAware
FormBuilderInterface $builder,
$exportAlias,
array $aggregatorAliases,
) {
): void {
$builder
->add('format', ChoiceType::class, [
'choices' => [
@@ -107,7 +107,7 @@ class SpreadsheetListFormatter implements FormatterInterface, ExportManagerAware
return ['numerotation' => true, 'format' => 'xlsx'];
}
public function getName()
public function getName(): string|\Symfony\Contracts\Translation\TranslatableInterface
{
return 'Spreadsheet list formatter (.xlsx, .ods)';
}
@@ -218,7 +218,7 @@ class SpreadsheetListFormatter implements FormatterInterface, ExportManagerAware
return $response;
}
public function getType()
public function getType(): string
{
return FormatterInterface::TYPE_LIST;
}

View File

@@ -534,12 +534,12 @@ class DummyFilterWithApplying implements FilterInterface
private readonly string $applyOn,
) {}
public function getTitle()
public function getTitle(): string|\Symfony\Contracts\Translation\TranslatableInterface
{
return 'dummy';
}
public function buildForm(FormBuilderInterface $builder) {}
public function buildForm(FormBuilderInterface $builder): void {}
public function getNormalizationVersion(): int
{
@@ -561,7 +561,7 @@ class DummyFilterWithApplying implements FilterInterface
return [];
}
public function describeAction($data, $format = 'string')
public function describeAction($data, $format = 'string'): string|\Symfony\Contracts\Translation\TranslatableInterface|array
{
return ['dummy filter', []];
}
@@ -571,9 +571,9 @@ class DummyFilterWithApplying implements FilterInterface
return $this->role;
}
public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) {}
public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void {}
public function applyOn()
public function applyOn(): string
{
return $this->applyOn;
}
@@ -589,7 +589,7 @@ class DummyExport implements ExportInterface
private readonly array $supportedModifiers,
) {}
public function getTitle()
public function getTitle(): string|\Symfony\Contracts\Translation\TranslatableInterface
{
return 'dummy';
}
@@ -631,17 +631,17 @@ class DummyExport implements ExportInterface
return [];
}
public function getQueryKeys($data)
public function getQueryKeys($data): array
{
return [];
}
public function getResult($query, $data, \Chill\MainBundle\Export\ExportGenerationContext $context)
public function getResult($query, $data, \Chill\MainBundle\Export\ExportGenerationContext $context): array
{
return [];
}
public function getType()
public function getType(): string
{
return 'dummy';
}

View File

@@ -119,7 +119,7 @@ class SortExportElementTest extends KernelTestCase
return new class ($title) implements AggregatorInterface {
public function __construct(private readonly string $title) {}
public function buildForm(FormBuilderInterface $builder) {}
public function buildForm(FormBuilderInterface $builder): void {}
public function getNormalizationVersion(): int
{
@@ -146,12 +146,12 @@ class SortExportElementTest extends KernelTestCase
return fn ($v) => $v;
}
public function getQueryKeys($data)
public function getQueryKeys($data): array
{
return [];
}
public function getTitle()
public function getTitle(): string|\Symfony\Contracts\Translation\TranslatableInterface
{
return $this->title;
}
@@ -161,9 +161,9 @@ class SortExportElementTest extends KernelTestCase
return null;
}
public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) {}
public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void {}
public function applyOn()
public function applyOn(): string
{
return [];
}
@@ -175,12 +175,12 @@ class SortExportElementTest extends KernelTestCase
return new class ($title) implements FilterInterface {
public function __construct(private readonly string $title) {}
public function getTitle()
public function getTitle(): string|\Symfony\Contracts\Translation\TranslatableInterface
{
return $this->title;
}
public function buildForm(FormBuilderInterface $builder) {}
public function buildForm(FormBuilderInterface $builder): void {}
public function getNormalizationVersion(): int
{
@@ -202,7 +202,7 @@ class SortExportElementTest extends KernelTestCase
return [];
}
public function describeAction($data, $format = 'string')
public function describeAction($data, $format = 'string'): string|\Symfony\Contracts\Translation\TranslatableInterface|array
{
return ['a', []];
}
@@ -212,9 +212,9 @@ class SortExportElementTest extends KernelTestCase
return null;
}
public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext) {}
public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void {}
public function applyOn()
public function applyOn(): string
{
return [];
}