chore: merge master

This commit is contained in:
Maël Gangloff
2025-03-03 12:58:38 +01:00
10 changed files with 112 additions and 42 deletions

View File

@@ -13,7 +13,6 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\Serializer\Exception\ExceptionInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Validator\ConstraintViolationInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
/**
@@ -58,8 +57,8 @@ abstract class AbstractProvider
$data = $this->serializer->denormalize($this->verifyLegalAuthData($authData), $this->dtoClass);
$violations = $this->validator->validate($data);
if ($violations->count()) {
throw new BadRequestHttpException(implode('\n', array_map(fn (ConstraintViolationInterface $v) => $v->getPropertyPath().': '.$v->getMessage(), iterator_to_array($violations))));
if ($violations->count() > 0) {
throw new BadRequestHttpException((string) $violations);
}
return [

View File

@@ -2,6 +2,7 @@
namespace App\Service\Connector;
use App\Dto\Connector\NameComProviderDto;
use App\Entity\Domain;
use Psr\Cache\CacheItemInterface;
use Psr\Cache\CacheItemPoolInterface;
@@ -21,9 +22,10 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
#[Autoconfigure(public: true)]
class NameComProvider extends AbstractProvider
{
protected string $dtoClass = NameComProvider::class;
protected string $dtoClass = NameComProviderDto::class;
public function __construct(CacheItemPoolInterface $cacheItemPool,
public function __construct(
CacheItemPoolInterface $cacheItemPool,
private readonly HttpClientInterface $client,
private readonly KernelInterface $kernel,
DenormalizerInterface&NormalizerInterface $serializer,