From 3122098447e9c64ab7e4e6f350620d31e370931e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 2 May 2022 16:29:47 +0200 Subject: [PATCH] remove privateCommentRender --- .../Entity/PrivateCommentRender.php | 72 ------------------- .../config/services/templating.yaml | 4 -- 2 files changed, 76 deletions(-) delete mode 100644 src/Bundle/ChillMainBundle/Templating/Entity/PrivateCommentRender.php diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/PrivateCommentRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/PrivateCommentRender.php deleted file mode 100644 index d47cb2296..000000000 --- a/src/Bundle/ChillMainBundle/Templating/Entity/PrivateCommentRender.php +++ /dev/null @@ -1,72 +0,0 @@ -engine = $engine; - $this->sercurity = $security; - } - - /** - * @param PrivateCommentEmbeddable $entity - */ - public function renderBox($entity, array $options): string - { - // default options - $options = array_merge([ - 'user' => [], - 'disable_markdown' => false, - 'limit_lines' => null, - 'metadata' => true, - ], $options); - - return $this->engine - ->render( - '@ChillMain/Entity/CommentEmbeddable.html.twig', - [ - 'opening_box' => $this->getDefaultOpeningBox('comment-embeddable'), - 'closing_box' => $this->getDefaultClosingBox(), - 'user' => $this->security->getUser() ?? null, - 'comment' => $entity->getCommentForUser($this->security->getUser()), - 'options' => $options, - ] - ); - } - - /** - * @param PrivateCommentEmbeddable $entity - */ - public function renderString($entity, array $options): string - { - return $entity->getCommentForUser($this->security->getUser()); - } - - public function supports($entity, array $options): bool - { - return $entity instanceof PrivateCommentEmbeddable; - } -} diff --git a/src/Bundle/ChillMainBundle/config/services/templating.yaml b/src/Bundle/ChillMainBundle/config/services/templating.yaml index bd8d99786..e69700732 100644 --- a/src/Bundle/ChillMainBundle/config/services/templating.yaml +++ b/src/Bundle/ChillMainBundle/config/services/templating.yaml @@ -41,10 +41,6 @@ services: tags: - { name: 'chill.render_entity' } - Chill\MainBundle\Templating\Entity\PrivateCommentRender: - tags: - - { name: 'chill.render_entity' } - Chill\MainBundle\Templating\ChillMarkdownRenderExtension: tags: - { name: twig.extension }