mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
php csfixes
This commit is contained in:
@@ -19,7 +19,6 @@ use Symfony\Component\Security\Core\Security;
|
||||
|
||||
final class PrivateCommentDataMapper extends AbstractType implements DataMapperInterface
|
||||
{
|
||||
|
||||
private Security $security;
|
||||
|
||||
public function __construct(Security $security)
|
||||
@@ -40,8 +39,6 @@ final class PrivateCommentDataMapper extends AbstractType implements DataMapperI
|
||||
$forms = iterator_to_array($forms);
|
||||
|
||||
$forms['comments']->setData($viewData->getCommentForUser($this->security->getUser()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function mapFormsToData($forms, &$viewData)
|
||||
@@ -50,5 +47,4 @@ final class PrivateCommentDataMapper extends AbstractType implements DataMapperI
|
||||
|
||||
$viewData->setCommentForUser($this->security->getUser(), $forms['comments']->getData());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -11,17 +11,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Form\Type;
|
||||
|
||||
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
|
||||
use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable;
|
||||
use Chill\MainBundle\Form\DataMapper\PrivateCommentDataMapper;
|
||||
use DateTime;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
@@ -30,10 +24,10 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
class PrivateCommentType extends AbstractType
|
||||
{
|
||||
protected UserInterface $user;
|
||||
|
||||
protected PrivateCommentDataMapper $dataMapper;
|
||||
|
||||
protected UserInterface $user;
|
||||
|
||||
public function __construct(TokenStorageInterface $tokenStorage, PrivateCommentDataMapper $dataMapper)
|
||||
{
|
||||
$this->user = $tokenStorage->getToken()->getUser();
|
||||
@@ -44,7 +38,7 @@ class PrivateCommentType extends AbstractType
|
||||
{
|
||||
$builder
|
||||
->add('comments', ChillTextareaType::class, [
|
||||
'label' => 'private comment'
|
||||
'label' => 'private comment',
|
||||
])
|
||||
->setDataMapper($this->dataMapper);
|
||||
}
|
||||
|
Reference in New Issue
Block a user