TreeViewHelper::initializeArguments()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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