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:
@@ -13,6 +13,7 @@ namespace Chill\MainBundle\Entity\Embeddable;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use function array_key_exists;
|
||||
|
||||
/**
|
||||
* @ORM\Embeddable
|
||||
@@ -21,6 +22,7 @@ class PrivateCommentEmbeddable
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="json", nullable=false, options={"default": "{}"})
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
private array $comments = [];
|
||||
@@ -30,17 +32,17 @@ class PrivateCommentEmbeddable
|
||||
return $this->comments[$user->getId()] ?? '';
|
||||
}
|
||||
|
||||
public function hasCommentForUser(User $user): bool
|
||||
{
|
||||
return array_key_exists($user->getId(), $this->comments)
|
||||
&& "" !== $this->comments[$user->getId()];
|
||||
}
|
||||
|
||||
public function getComments(): ?array
|
||||
{
|
||||
return $this->comments;
|
||||
}
|
||||
|
||||
public function hasCommentForUser(User $user): bool
|
||||
{
|
||||
return array_key_exists($user->getId(), $this->comments)
|
||||
&& '' !== $this->comments[$user->getId()];
|
||||
}
|
||||
|
||||
public function merge(PrivateCommentEmbeddable $newComment): self
|
||||
{
|
||||
$currentComments = null === $this->getComments() ? [] : $this->getComments();
|
||||
|
Reference in New Issue
Block a user