mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
chore: merge master
This commit is contained in:
@@ -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 [
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user