Completed
Push — master ( bc4bd1...b40f3e )
by Timo
05:05
created

BackendControllerHook::addJavaScript()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
namespace ApacheSolrForTypo3\Tika\Hooks;
3
4
use TYPO3\CMS\Backend\Controller\BackendController;
0 ignored issues
show
Bug introduced by
The type TYPO3\CMS\Backend\Controller\BackendController 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...
5
use TYPO3\CMS\Backend\Utility\BackendUtility;
0 ignored issues
show
Bug introduced by
The type TYPO3\CMS\Backend\Utility\BackendUtility 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...
6
use TYPO3\CMS\Core\Page\PageRenderer;
7
use TYPO3\CMS\Core\Utility\GeneralUtility;
8
9
/**
10
 * This class adds Filelist related JavaScript to the backend
11
 */
12
class BackendControllerHook
13
{
14
    /**
15
     * Adds Filelist JavaScript used e.g. by context menu
16
     *
17
     * @param array $configuration
18
     * @param BackendController $backendController
19
     */
20
    public function addJavaScript(array $configuration, BackendController $backendController)
0 ignored issues
show
Unused Code introduced by
The parameter $configuration is not used and could be removed. ( Ignorable by Annotation )

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

20
    public function addJavaScript(/** @scrutinizer ignore-unused */ array $configuration, BackendController $backendController)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $backendController is not used and could be removed. ( Ignorable by Annotation )

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

20
    public function addJavaScript(array $configuration, /** @scrutinizer ignore-unused */ BackendController $backendController)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
21
    {
22
        $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
23
        $pageRenderer->addInlineSetting('TikaPreview', 'moduleUrl', BackendUtility::getModuleUrl('tika_preview'));
24
    }
25
}
26