AdminController::indexAction()   A
last analyzed

Complexity

Conditions 5
Paths 6

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 5
eloc 8
c 1
b 0
f 0
nc 6
nop 0
dl 0
loc 15
rs 9.6111
1
<?php
2
3
/**
4
 * @license GPLv3, http://www.gnu.org/copyleft/gpl.html
5
 * @copyright Aimeos (aimeos.org), 2015-2017
6
 * @package TYPO3
7
 */
8
9
10
namespace Aimeos\Aimeos\Controller;
11
12
use TYPO3\CMS\Extbase\Http\ForwardResponse;
13
14
15
/**
16
 * Controller for the admin interface
17
 *
18
 * @package TYPO3
19
 */
20
class AdminController extends AbstractController
21
{
22
    /**
23
     * Forwards to the configured admin interface
24
     */
25
    public function indexAction()
26
    {
27
        $site = 'default';
28
29
        if (isset($GLOBALS['BE_USER']->user['siteid']) && $GLOBALS['BE_USER']->user['siteid'] != '') {
30
            $siteManager = \Aimeos\MShop::create($this->contextBackend(), 'locale/site');
31
            $siteId = current(array_reverse(explode('.', trim($GLOBALS['BE_USER']->user['siteid'], '.'))));
32
            $site = ($siteId ? $siteManager->get($siteId)->getCode() : 'default');
33
        }
34
35
        if (!class_exists('\TYPO3\CMS\Extbase\Http\ForwardResponse')) {
36
            return $this->forward('search', 'Jqadm', null, ['site' => $site]);
0 ignored issues
show
Bug introduced by
The method forward() does not exist on Aimeos\Aimeos\Controller\AdminController. Did you maybe mean forwardToReferringRequest()? ( Ignorable by Annotation )

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

36
            return $this->/** @scrutinizer ignore-call */ forward('search', 'Jqadm', null, ['site' => $site]);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
        }
38
39
        return (new ForwardResponse('search'))->withControllerName('Jqadm')->withArguments(['site' => $site]);
40
    }
41
}
42