Passed
Push — master ( 847fb8...bb8f79 )
by Timo
24:45
created

LastSearchesController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 13
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A indexAction() 0 8 1
1
<?php
2
namespace ApacheSolrForTypo3\Solr\ViewHelpers\Widget\Controller;
3
4
/*
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under
8
 * the terms of the GNU General Public License, either version 2
9
 * of the License, or any later version.
10
 *
11
 * For the full copyright and license information, please read the
12
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
 * The TYPO3 project - inspiring people to share!
15
 */
16
17
use ApacheSolrForTypo3\Solr\Domain\Search\LastSearches\LastSearchesService;
18
use ApacheSolrForTypo3\Solr\Widget\AbstractWidgetController;
19
use TYPO3\CMS\Core\Utility\GeneralUtility;
20
21
/**
22
 * Class LastSearchesController
23
 *
24
 * @author Frans Saris <[email protected]>
25
 * @author Timo Hund <[email protected]>
26
 * @package ApacheSolrForTypo3\Solr\ViewHelpers\Widget\Controller
27
 */
28
class LastSearchesController extends AbstractWidgetController
29
{
30
    /**
31
     * Last searches
32
     */
33 32
    public function indexAction()
34
    {
35 32
        $typoScriptConfiguration = $this->controllerContext->getTypoScriptConfiguration();
36 32
        $lastSearchesService = GeneralUtility::makeInstance(
37 32
            LastSearchesService::class,
38 32
            /** @scrutinizer ignore-type */ $typoScriptConfiguration
39
        );
40 32
        $this->view->assign('contentArguments', ['lastSearches' => $lastSearchesService->getLastSearches()]);
41 32
    }
42
}
43