Passed
Pull Request — master (#123)
by
unknown
04:16
created

ImplodeViewHelper::initializeArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
/**
3
 * (c) Kitodo. Key to digital objects e.V. <[email protected]>
4
 *
5
 * This file is part of the Kitodo and TYPO3 projects.
6
 *
7
 * @license GNU General Public License version 3 or later.
8
 * For the full copyright and license information, please read the
9
 * LICENSE.txt file that was distributed with this source code.
10
 */
11
12
namespace Kitodo\Dlf\ViewHelpers;
13
14
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
15
16
class ImplodeViewHelper extends AbstractViewHelper
17
{
18
    public function initializeArguments()
19
    {
20
        parent::initializeArguments();
21
        $this->registerArgument('value', 'array', 'The array to be imploded', true);
22
        $this->registerArgument('delimiter', 'string', 'The delimiter ', true);
23
    }
24
25
    /**
26
     * Checks if a value exists in an array.
27
     *
28
     * @return string
29
     */
30
    public function render()
31
    {
32
        $value = $this->arguments['value'];
33
        $delimiter = $this->arguments['delimiter'];
34
35
        return implode($delimiter, $value);
36
    }
37
}
38