TypoScriptFrontend   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 8
Bugs 1 Features 1
Metric Value
wmc 4
c 8
b 1
f 1
lcom 0
cbo 3
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A endOfRendering() 0 12 4
1
<?php
2
/**
3
 * Hook the TSFE output
4
 *
5
 * @author  Tim Lochmüller
6
 */
7
8
namespace FRUIT\Ink\Hooks;
9
10
use FRUIT\Ink\Postprocessing\PostprocessingInterface;
11
use TYPO3\CMS\Core\Utility\GeneralUtility;
12
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
13
14
/**
15
 * Hook the TSFE output
16
 */
17
class TypoScriptFrontend
18
{
19
20
    /**
21
     * Call the end of rendering hook
22
     *
23
     * @hook TYPO3_CONF_VARS|SC_OPTIONS|tslib/class.tslib_fe.php|hook_eofe
24
     *
25
     * @param array                        $params
26
     * @param TypoScriptFrontendController $obj
27
     */
28
    public function endOfRendering(array $params, TypoScriptFrontendController $obj)
0 ignored issues
show
Unused Code introduced by
The parameter $params is not used and could be removed.

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

Loading history...
29
    {
30
        if (!isset($obj->config['config']['newsletterPostprocessing.']) || !is_array($obj->config['config']['newsletterPostprocessing.'])) {
31
            return;
32
        }
33
34
        foreach ($obj->config['config']['newsletterPostprocessing.'] as $postprocessorClass) {
35
            /** @var PostprocessingInterface $processor */
36
            $processor = GeneralUtility::makeInstance($postprocessorClass);
37
            $obj->content = $processor->process($obj->content);
38
        }
39
    }
40
}
41