Passed
Push — master ( 757841...94ec22 )
by Goffy
06:13 queued 02:50
created

admin/menu.php (1 issue)

Labels
Severity
1
<?php declare(strict_types=1);
2
3
/**
4
 * ****************************************************************************
5
 * MYIFRAME - MODULE FOR XOOPS
6
 * Copyright (c) Hervé Thouzard of Instant Zero (https://www.instant-zero.com)
7
 * ****************************************************************************
8
 */
9
10
use Xmf\Module\Admin;
11
use XoopsModules\Myiframe;
12
13
/** @var Myiframe\Helper $helper */
14
$moduleDirName      = \basename(\dirname(__DIR__));
15
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
16
17
$helper = Myiframe\Helper::getInstance();
18
$helper->loadLanguage('common');
19
$helper->loadLanguage('feedback');
20
21
$pathIcon32    = Admin::menuIconPath('');
22
$pathModIcon32 = XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images/icons/32/';
23
if (is_object($helper->getModule())
24
    && false !== $helper->getModule()
25
                        ->getInfo('modicons32')) {
26
    $pathModIcon32 = $helper->url(
27
        $helper->getModule()
0 ignored issues
show
It seems like $helper->getModule()->getInfo('modicons32') can also be of type array; however, parameter $url of Xmf\Module\Helper\GenericHelper::url() does only seem to accept string, 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

27
        /** @scrutinizer ignore-type */ $helper->getModule()
Loading history...
28
               ->getInfo('modicons32')
29
    );
30
}
31
32
$adminmenu[] = [
33
    'title' => _MI_MYIFRAME_NAME,
34
    'link'  => 'admin/index.php',
35
    'icon'  => $pathIcon32 . '/home.png',
36
];
37
38
$adminmenu[] = [
39
    'title' => _MI_MYIFRAME_ADMENU1,
40
    'link'  => 'admin/manage.php',
41
    'icon'  => $pathIcon32 . '/manage.png',
42
];
43
44
// Blocks Admin
45
$adminmenu[] = [
46
    'title' => constant('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS'),
47
    'link'  => 'admin/blocksadmin.php',
48
    'icon'  => $pathIcon32 . '/block.png',
49
];
50
51
if (is_object($helper->getModule()) && $helper->getConfig('displayDeveloperTools')) {
52
    $adminmenu[] = [
53
        'title' => constant('CO_' . $moduleDirNameUpper . '_' . 'ADMENU_MIGRATE'),
54
        'link'  => 'admin/migrate.php',
55
        'icon'  => $pathIcon32 . '/database_go.png',
56
    ];
57
}
58
59
// Category
60
$adminmenu[] = [
61
    'title' => _MI_MYIFRAME_ADMENU2,
62
    'link'  => 'admin/about.php',
63
    'icon'  => $pathIcon32 . '/about.png',
64
65
];
66