mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
php csfixes
This commit is contained in:
@@ -24,15 +24,25 @@ class PrivateCommentEmbeddable
|
||||
*/
|
||||
private ?array $comments = [];
|
||||
|
||||
public function getCommentForUser(User $user): string
|
||||
{
|
||||
return $this->comments[$user->getId()] ?? '';
|
||||
}
|
||||
|
||||
public function getComments(): ?array
|
||||
{
|
||||
return $this->comments;
|
||||
}
|
||||
|
||||
|
||||
public function getCommentForUser(User $user): string
|
||||
public function merge(PrivateCommentEmbeddable $newComment): self
|
||||
{
|
||||
return $this->comments[$user->getId()] ?? '';
|
||||
$currentComments = null === $this->getComments() ? [] : $this->getComments();
|
||||
|
||||
$mergedComments = $newComment->getComments() + $currentComments;
|
||||
|
||||
$this->setComments($mergedComments);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCommentForUser(User $user, string $content): self
|
||||
@@ -48,16 +58,4 @@ class PrivateCommentEmbeddable
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function merge(PrivateCommentEmbeddable $newComment): self
|
||||
{
|
||||
|
||||
$currentComments = null === $this->getComments() ? [] : $this->getComments();
|
||||
|
||||
$mergedComments = $newComment->getComments() + $currentComments;
|
||||
|
||||
$this->setComments($mergedComments);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user