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 (#744)
by
unknown
03:10
created

IsArrayViewHelper::renderStatic()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 7
c 1
b 0
f 0
nc 4
nop 3
dl 0
loc 14
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
use TYPO3Fluid\Fluid\RenderingContextInterface;
0 ignored issues
show
Bug introduced by
The type TYPO3Fluid\Fluid\RenderingContextInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
17
class IsArrayViewHelper extends AbstractViewHelper
18
{
19
    /**
20
     * Register arguments.
21
     */
22
    public function initializeArguments()
23
    {
24
        parent::initializeArguments();
25
        $this->registerArgument('variable', 'mixed', 'The variable to check', false, null);
26
    }
27
28
    /**
29
     * @return bool
30
     */
31
    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
32
    {
33
        $result = false;
34
35
        $variable = $arguments['variable'];
36
        if (null === $variable) {
37
            $variable = $renderChildrenClosure();
38
        }
39
40
        if (null !== $variable) {
41
            $result = is_array($variable);
42
        }
43
44
        return $result;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $result returns the type boolean 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...
45
    }
46
}
47