TreeViewHelper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 33
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initializeArguments() 0 6 1
A render() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Filoucrackeur\StorageFrameworkManager\ViewHelpers;
5
6
use Filoucrackeur\StorageFrameworkManager\Utility\TreeUtility;
7
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
8
9
class TreeViewHelper extends AbstractViewHelper
10
{
11
12
    /**
13
     * @var bool
14
     */
15
    protected $escapeOutput = false;
16
17
    /**
18
     * @var bool
19
     */
20
    protected $escapeChildren = false;
21
22
    /**
23
     * Initialize arguments.
24
     */
25
    public function initializeArguments()
26
    {
27
        parent::initializeArguments();
28
        $this->registerArgument('value', 'array', 'array to convert to tree', true);
29
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function render(): string
36
    {
37
        $array = $this->arguments['value'];
38
39
        return TreeUtility::fromArray($array);
40
    }
41
}
42