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.
Passed
Pull Request — dev-extbase-fluid (#757)
by Alexander
05:02 queued 02:23
created

ParseMetadataWrapViewHelper::renderStatic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 8
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
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
19
20
class ParseMetadataWrapViewHelper extends AbstractViewHelper
21
{
22
    protected $escapeOutput = false;
23
24
    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
25
    {
26
        $parser = GeneralUtility::makeInstance(TypoScriptParser::class);
27
        $parser->parse($renderChildrenClosure());
28
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array('key' => $p...$parser->setup['all.']) returns the type array which is incompatible with the return type mandated by TYPO3Fluid\Fluid\Core\Vi...terface::renderStatic() of string.

In the issue above, the returned value is violating the contract defined by the mentioned interface.

Let's take a look at an example:

interface HasName {
    /** @return string */
    public function getName();
}

class Name {
    public $name;
}

class User implements HasName {
    /** @return string|Name */
    public function getName() {
        return new Name('foo'); // This is a violation of the ``HasName`` interface
                                // which only allows a string value to be returned.
    }
}
Loading history...
29
            'key' => $parser->setup['key.'],
30
            'value' => $parser->setup['value.'],
31
            'all' => $parser->setup['all.'],
32
        ];
33
    }
34
}
35