mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
fix cs
This commit is contained in:
@@ -12,7 +12,6 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Serializer\Normalizer;
|
||||
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
||||
use Chill\PersonBundle\Templating\Entity\SocialActionRender;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
|
||||
@@ -41,8 +40,8 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte
|
||||
'desactivationDate' => $this->normalizer->normalize($socialAction->getDesactivationDate()),
|
||||
'title' => $socialAction->getTitle(),
|
||||
];
|
||||
case 'docgen':
|
||||
|
||||
case 'docgen':
|
||||
if (null === $socialAction) {
|
||||
return ['id' => 0, 'title' => '', 'text' => ''];
|
||||
}
|
||||
@@ -52,12 +51,13 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte
|
||||
'text' => $this->render->renderString($socialAction, []),
|
||||
'title' => $socialAction->getTitle(),
|
||||
];
|
||||
|
||||
default:
|
||||
throw new \Symfony\Component\Serializer\Exception\RuntimeException("format not supported");
|
||||
throw new \Symfony\Component\Serializer\Exception\RuntimeException('format not supported');
|
||||
}
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, string $format = null, array $context = [])
|
||||
public function supportsNormalization($data, ?string $format = null, array $context = [])
|
||||
{
|
||||
if ($data instanceof SocialAction && 'json' === $format) {
|
||||
return true;
|
||||
@@ -68,7 +68,7 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte
|
||||
return true;
|
||||
}
|
||||
|
||||
if (null === $data && ($context['docgen:expects'] ?? null) === SocialAction::class) {
|
||||
if (null === $data && SocialAction::class === ($context['docgen:expects'] ?? null)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user