[BUGFIX] Optimize implementation of CompilableInterface 79/39179/3
authorFrank Nägler <typo3@naegler.net>
Fri, 1 May 2015 22:05:40 +0000 (00:05 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 2 May 2015 09:45:08 +0000 (11:45 +0200)
In some cases the implementation of CompilableInterface is not correct.
Implementing renderStatic and compile at the same time makes no sense.
This patch removes the renderStatic method in case compile is implemented too.

Resolves: #66726
Related: #66711
Releases: master
Change-Id: Idd7db07f5386c840ca3877b22748c9ed35efa426
Reviewed-on: http://review.typo3.org/39179
Reviewed-by: Dirk Jüttner <dirk.juettner@gmail.com>
Tested-by: Dirk Jüttner <dirk.juettner@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/fluid/Classes/ViewHelpers/CommentViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Format/HtmlspecialcharsViewHelper.php

index dbab00e..03b4ec8 100644 (file)
@@ -62,17 +62,6 @@ class CommentViewHelper extends AbstractViewHelper implements CompilableInterfac
         * @api
         */
        public function render() {
-       }
-
-       /**
-        * Does not render children
-        *
-        * @param array $arguments
-        * @param \Closure $renderChildrenClosure
-        * @param RenderingContextInterface $renderingContext
-        * @return string
-        */
-       static public function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
                return '';
        }
 
index 9903861..9e191be 100644 (file)
@@ -58,31 +58,8 @@ class HtmlspecialcharsViewHelper extends AbstractEncodingViewHelper implements C
         * @api
         */
        public function render($value = NULL, $keepQuotes = FALSE, $encoding = NULL, $doubleEncode = TRUE) {
-               return self::renderStatic(
-                       array(
-                               'value' => $value,
-                               'keepQuotes' => $keepQuotes,
-                               'encoding' => $encoding,
-                               'doubleEncode' => $doubleEncode
-                       ),
-                       $this->buildRenderChildrenClosure(),
-                       $this->renderingContext
-               );
-       }
-
-       /**
-        * @param array $arguments
-        * @param callable $renderChildrenClosure
-        * @param RenderingContextInterface $renderingContext
-        * @return string
-        */
-       static public function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
-               $value = $arguments['value'];
-               $keepQuotes = $arguments['keepQuotes'];
-               $encoding = $arguments['encoding'];
-               $doubleEncode = $arguments['doubleEncode'];
                if ($value === NULL) {
-                       $value = $renderChildrenClosure();
+                       $value = $this->renderChildren();
                }
                if (!is_string($value)) {
                        return $value;
@@ -113,4 +90,4 @@ class HtmlspecialcharsViewHelper extends AbstractEncodingViewHelper implements C
                                $valueVariableName, $valueVariableName, $valueVariableName, $argumentsVariableName, $argumentsVariableName, $argumentsVariableName, $argumentsVariableName);
        }
 
-}
\ No newline at end of file
+}