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
Push — master ( 14584b...f60880 )
by Sebastian
02:42
created

ImageManipulationTool   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A main() 0 9 1
1
<?php
2
namespace Kitodo\Dlf\Plugin\Tools;
3
4
/**
5
 * (c) Kitodo. Key to digital objects e.V. <[email protected]>
6
 *
7
 * This file is part of the Kitodo and TYPO3 projects.
8
 *
9
 * @license GNU General Public License version 3 or later.
10
 * For the full copyright and license information, please read the
11
 * LICENSE.txt file that was distributed with this source code.
12
 */
13
14
/**
15
 * Image Manipulation tool for the plugin 'Toolbox' of the 'dlf' extension
16
 *
17
 * @author Jacob Mendt <[email protected]>
18
 * @package TYPO3
19
 * @subpackage dlf
20
 * @access public
21
 */
22
class ImageManipulationTool extends \Kitodo\Dlf\Common\AbstractPlugin {
23
    public $scriptRelPath = 'Classes/Plugin/Tools/ImageManipulationTool.php';
24
25
    /**
26
     * The main method of the PlugIn
27
     *
28
     * @access public
29
     *
30
     * @param string $content: The PlugIn content
31
     * @param array $conf: The PlugIn configuration
32
     *
33
     * @return string The content that is displayed on the website
34
     */
35
    public function main($content, $conf) {
36
        $this->init($conf);
37
        // Merge configuration with conf array of toolbox.
38
        $this->conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->cObj->data['conf'], $this->conf);
0 ignored issues
show
Bug introduced by
It seems like $this->conf can also be of type null; however, parameter $overrule of TYPO3\CMS\Core\Utility\A...RecursiveWithOverrule() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

38
        $this->conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->cObj->data['conf'], /** @scrutinizer ignore-type */ $this->conf);
Loading history...
Bug introduced by
Are you sure the assignment to $this->conf is correct as TYPO3\CMS\Core\Utility\A...a['conf'], $this->conf) targeting TYPO3\CMS\Core\Utility\A...RecursiveWithOverrule() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
39
        // Load template file.
40
        $this->getTemplate();
41
        $markerArray['###IMAGEMANIPULATION_SELECT###'] = '<span class="tx-dlf-tools-imagetools" id="tx-dlf-tools-imagetools" data-dic="imagemanipulation-on:'.$this->pi_getLL('imagemanipulation-on', '', TRUE).';imagemanipulation-off:'.$this->pi_getLL('imagemanipulation-off', '', TRUE).';reset:'.$this->pi_getLL('reset', '', TRUE).';saturation:'.$this->pi_getLL('saturation', '', TRUE).';hue:'.$this->pi_getLL('hue', '', TRUE).';contrast:'.$this->pi_getLL('contrast', '', TRUE).';brightness:'.$this->pi_getLL('brightness', '', TRUE).';invert:'.$this->pi_getLL('invert', '', TRUE).'" title="'.$this->pi_getLL('no-support', '', TRUE).'"></span>';
1 ignored issue
show
Comprehensibility Best Practice introduced by
$markerArray was never initialized. Although not strictly required by PHP, it is generally a good practice to add $markerArray = array(); before regardless.
Loading history...
42
        $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray);
0 ignored issues
show
Deprecated Code introduced by
The function TYPO3\CMS\Frontend\Conte...substituteMarkerArray() has been deprecated: since TYPO3 v8, will be removed in TYPO3 v9, please use the MarkerBasedTemplateService instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

42
        $content .= /** @scrutinizer ignore-deprecated */ $this->cObj->substituteMarkerArray($this->template, $markerArray);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
43
        return $this->pi_wrapInBaseClass($content);
44
    }
45
}
46