Passed
Pull Request — master (#40)
by
unknown
04:48
created

MollieMenuListener   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 16
c 0
b 0
f 0
dl 0
loc 23
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildMenu() 0 21 1
1
<?php
2
3
/*
4
 * This file has been created by developers from BitBag.
5
 * Feel free to contact us once you face any issues or want to start
6
 * another great project.
7
 * You can find more information about us on https://bitbag.io and write us
8
 * an email on [email protected].
9
 */
10
11
declare(strict_types=1);
12
13
namespace BitBag\SyliusMolliePlugin\Menu;
14
15
use Sylius\Bundle\UiBundle\Menu\Event\MenuBuilderEvent;
16
17
final class MollieMenuListener
18
{
19
    public function buildMenu(MenuBuilderEvent $menuBuilderEvent): void
20
    {
21
        $menu = $menuBuilderEvent->getMenu();
22
        $cmsRootMenuItem =
23
            $menu
24
                ->addChild('mollie')
25
                ->setLabel('bitbag_sylius_mollie_plugin.ui.mollie_gateway_label');
26
27
        $cmsRootMenuItem
28
            ->addChild('mollie_logger', [
29
                'route' => 'bitbag_sylius_mollie_plugin_admin_mollie_logger_index',
30
            ])
31
            ->setLabel('bitbag_sylius_mollie_plugin.ui.mollie_loggers')
32
            ->setLabelAttribute('icon', 'tags');
33
34
        $cmsRootMenuItem
35
            ->addChild('mollie_product_type', [
36
                'route' => 'bitbag_sylius_mollie_plugin_admin_product_type_index',
37
            ])
38
            ->setLabel('bitbag_sylius_mollie_plugin.ui.mollie_product_type')
39
            ->setLabelAttribute('icon', 'sitemap');
40
    }
41
}
42