mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
php csfixes
This commit is contained in:
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Serializer\Normalizer;
|
||||
|
||||
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
|
||||
use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
||||
@@ -19,7 +18,6 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
|
||||
class PrivateCommentEmbeddableNormalizer implements NormalizerInterface, DenormalizerInterface
|
||||
{
|
||||
|
||||
private Security $security;
|
||||
|
||||
public function __construct(Security $security)
|
||||
@@ -40,19 +38,18 @@ class PrivateCommentEmbeddableNormalizer implements NormalizerInterface, Denorma
|
||||
return $comment;
|
||||
}
|
||||
|
||||
public function supportsDenormalization($data, string $type, ?string $format = null): bool
|
||||
{
|
||||
return $type === PrivateCommentEmbeddable::class;
|
||||
}
|
||||
|
||||
public function normalize($comment, $format = null, array $contect = []): string
|
||||
{
|
||||
return $comment->getCommentForUser($this->security->getUser());
|
||||
}
|
||||
|
||||
public function supportsDenormalization($data, string $type, ?string $format = null): bool
|
||||
{
|
||||
return PrivateCommentEmbeddable::class === $type;
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, ?string $format = null): bool
|
||||
{
|
||||
return $data instanceof PrivateCommentEmbeddable;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user