Completed
Pull Request — master (#214)
by Claus
03:52
created

CompileWithRenderStatic::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 8
rs 9.4285
c 1
b 0
f 0
1
<?php
2
namespace TYPO3Fluid\Fluid\Core\ViewHelper\Traits;
3
4
use TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler;
5
use TYPO3Fluid\Fluid\Core\Compiler\ViewHelperCompiler;
6
use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode;
7
8
/**
9
 * Class CompilableWithRenderStatic
10
 *
11
 * Provides default methods for rendering and compiling
12
 * any ViewHelper that conforms to the `renderStatic`
13
 * method pattern.
14
 */
15
trait CompileWithRenderStatic
16
{
17
    /**
18
     * @param string $argumentsName
19
     * @param string $closureName
20
     * @param string $initializationPhpCode
21
     * @param ViewHelperNode $node
22
     * @param TemplateCompiler $compiler
23
     * @return string
24
     */
25 View Code Duplication
    public function compile(
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
        $argumentsName,
27
        $closureName,
28
        &$initializationPhpCode,
29
        ViewHelperNode $node,
0 ignored issues
show
Unused Code introduced by
The parameter $node is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30
        TemplateCompiler $compiler
0 ignored issues
show
Unused Code introduced by
The parameter $compiler is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
31
    ) {
32
        list ($initialization, $execution) = ViewHelperCompiler::getInstance()->compileWithCallToStaticMethod(
33
            $this,
34
            $argumentsName,
35
            $closureName
36
        );
37
        $initializationPhpCode .= $initialization;
38
        return $execution;
39
    }
40
}
41