mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
fix issue with null comment and set correct variable name in signature
This commit is contained in:
parent
5e5a855578
commit
f3800ff38f
@ -27,20 +27,20 @@ class PrivateCommentEmbeddableNormalizer implements NormalizerInterface, Denorma
|
|||||||
|
|
||||||
public function denormalize($data, string $type, ?string $format = null, array $context = []): PrivateCommentEmbeddable
|
public function denormalize($data, string $type, ?string $format = null, array $context = []): PrivateCommentEmbeddable
|
||||||
{
|
{
|
||||||
if (null === $data) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$comment = new PrivateCommentEmbeddable();
|
$comment = new PrivateCommentEmbeddable();
|
||||||
|
|
||||||
|
if (null === $data) {
|
||||||
|
return $comment;
|
||||||
|
}
|
||||||
|
|
||||||
$comment->setCommentForUser($this->security->getUser(), $data);
|
$comment->setCommentForUser($this->security->getUser(), $data);
|
||||||
|
|
||||||
return $comment;
|
return $comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function normalize($comment, $format = null, array $contect = []): string
|
public function normalize($object, $format = null, array $context = []): string
|
||||||
{
|
{
|
||||||
return $comment->getCommentForUser($this->security->getUser());
|
return $object->getCommentForUser($this->security->getUser());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function supportsDenormalization($data, string $type, ?string $format = null): bool
|
public function supportsDenormalization($data, string $type, ?string $format = null): bool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user