. */ declare(strict_types=1); namespace App\Services\EntityMergers\Mergers; use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; /** * @template T of object */ #[AutoconfigureTag('app.entity_merger')] interface EntityMergerInterface { /** * Determines if this merger supports merging the other entity into the target entity. * @param object $target * @phpstan-param T $target * @param object $other * @phpstan-param T $other * @param array $context * @return bool True if this merger supports merging the other entity into the target entity, false otherwise */ public function supports(object $target, object $other, array $context = []): bool; /** * Merge the other entity into the target entity. * The target entity will be modified and returned. * @param object $target * @phpstan-param T $target * @param object $other * @phpstan-param T $other * @param array $context * @phpstan-return T * @return object */ public function merge(object $target, object $other, array $context = []): object; }