Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — dev-extbase-fluid ( 1e77b8...3a04ab )
by Alexander
19s queued 13s
created

initializeArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
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\Rendering\RenderingContextInterface;
15
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
16
use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser;
17
use TYPO3\CMS\Core\Utility\GeneralUtility;
18
19
/**
20
 * Viewhelper to parse TypoScript that is used to declare wrapping of metadata
21
 * fields and stores the result into a Fluid variable.
22
 *
23
 * The TypoScript should be passed as child and may contain stdWrap information
24
 * for:
25
 * - `key`: Used to wrap the metadata label
26
 * - `value`: Used to wrap the metadata value
27
 * - `all`: Used to wrap the full metadata line (after wrapping key and value)
28
 *
29
 * The name of the injected variable is passed as parameter.
30
 *
31
 * Example usage:
32
 *
33
 * ::
34
 *
35
 *     {typoscript -> kitodo:metadataWrapVariable(name: 'wrapInfo')}
36
 *
37
 */
38
class MetadataWrapVariableViewHelper extends AbstractViewHelper
39
{
40
    /**
41
     * @return void
42
     */
43
    public function initializeArguments()
44
    {
45
        $this->registerArgument('name', 'string', 'Name of variable to create', true);
46
    }
47
48
    /**
49
     * @param array $arguments
50
     * @param \Closure $renderChildrenClosure
51
     * @param RenderingContextInterface $renderingContext
52
     * @return null
53
     */
54
    public static function renderStatic(
55
        array $arguments,
56
        \Closure $renderChildrenClosure,
57
        RenderingContextInterface $renderingContext
58
    ) {
59
        $parser = GeneralUtility::makeInstance(TypoScriptParser::class);
60
        $parser->parse($renderChildrenClosure());
61
        $wrap = [
62
            'key' => $parser->setup['key.'],
63
            'value' => $parser->setup['value.'],
64
            'all' => $parser->setup['all.'],
65
        ];
66
        $renderingContext->getVariableProvider()->add($arguments['name'], $wrap);
67
    }
68
}
69