chill-bundles/src/Bundle/ChillMainBundle/Export/ExportElementValidatedInterface.php
Julien Fastré 8331a836f2
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.
2025-04-07 14:26:11 +02:00

36 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\MainBundle\Export;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
* Add a validation method to validate data collected by Export Element.
*
* Implements this interface on other `ExportElementInterface` to validate
* the form submitted by users.
*
* **note**: When this interface is implemented on filters or aggregators,
* the form is validated **only** if the filter/aggregator is `enabled` by the
* user.
*
* @see http://symfony.com/doc/current/validation/custom_constraint.html#class-constraint-validator Example of building violations
*/
interface ExportElementValidatedInterface
{
/**
* validate the form's data and, if required, build a contraint
* violation on the data.
*/
public function validateForm(mixed $data, ExecutionContextInterface $context): void;
}