mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-29 01:55:01 +00:00
change FilterInterface::describeAction signature to include context
This commit is contained in:
@@ -81,8 +81,9 @@ interface FilterInterface extends ModifierInterface
|
||||
* Example: `array('my string with %parameter%', ['%parameter%' => 'good news'], 'mydomain', 'mylocale')`
|
||||
*
|
||||
* @param D $data
|
||||
* @param ExportGenerationContext $context
|
||||
*
|
||||
* @return array|string|TranslatableInterface a string with the data or, if translatable, an array where first element is string, second elements is an array of arguments
|
||||
*/
|
||||
public function describeAction(array $data): array|string|TranslatableInterface;
|
||||
public function describeAction(array $data, ExportGenerationContext $context): array|string|TranslatableInterface;
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@ namespace Chill\MainBundle\Tests\Export;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Export\AggregatorInterface;
|
||||
use Chill\MainBundle\Export\ExportGenerationContext;
|
||||
use Chill\MainBundle\Export\ExportInterface;
|
||||
use Chill\MainBundle\Export\ExportManager;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
@@ -390,7 +391,7 @@ class DummyFilterWithApplying implements FilterInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): string|\Symfony\Contracts\Translation\TranslatableInterface|array
|
||||
public function describeAction($data, ExportGenerationContext $context, $format = 'string'): string|\Symfony\Contracts\Translation\TranslatableInterface|array
|
||||
{
|
||||
return ['dummy filter', []];
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\MainBundle\Tests\Export;
|
||||
|
||||
use Chill\MainBundle\Export\AggregatorInterface;
|
||||
use Chill\MainBundle\Export\ExportGenerationContext;
|
||||
use Chill\MainBundle\Export\ExportManager;
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Export\SortExportElement;
|
||||
@@ -207,7 +208,7 @@ class SortExportElementTest extends KernelTestCase
|
||||
return [];
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): string|TranslatableInterface|array
|
||||
public function describeAction($data, ExportGenerationContext $context, $format = 'string'): string|TranslatableInterface|array
|
||||
{
|
||||
return ['a', []];
|
||||
}
|
||||
|
Reference in New Issue
Block a user