mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +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
|
||||
{
|
||||
if (null === $data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$comment = new PrivateCommentEmbeddable();
|
||||
|
||||
if (null === $data) {
|
||||
return $comment;
|
||||
}
|
||||
|
||||
$comment->setCommentForUser($this->security->getUser(), $data);
|
||||
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user