Completed
Push — master ( 120557...b81336 )
by Craig
04:55
created

ExtensionMenu::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 6
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A ExtensionMenu::getBundleName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula - https://ziku.la/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Zikula\ThemeModule\Menu;
15
16
use Knp\Menu\ItemInterface;
17
use Zikula\MenuModule\ExtensionMenu\AbstractExtensionMenu;
18
19
class ExtensionMenu extends AbstractExtensionMenu
20
{
21
    protected function getAdmin(): ?ItemInterface
22
    {
23
        if (!$this->permissionApi->hasPermission($this->getBundleName() . '::', '::', ACCESS_ADMIN)) {
24
            return null;
25
        }
26
        $menu = $this->factory->createItem('themeAdminMenu');
27
        $menu->addChild('Settings', [
28
            'route' => 'zikulathememodule_config_config',
29
        ])->setAttribute('icon', 'fas fa-wrench');
30
31
        return 0 === $menu->count() ? null : $menu;
32
    }
33
34
    public function getBundleName(): string
35
    {
36
        return 'ZikulaThemeModule';
37
    }
38
}
39