Passed
Pull Request — master (#374)
by Arnaud
32:43 queued 25:11
created

UserMenuBuilder::buildMenu()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LAG\AdminBundle\Bridge\KnpMenu\Builder;
6
7
use Knp\Menu\FactoryInterface;
8
use Knp\Menu\ItemInterface;
9
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
10
11
class UserMenuBuilder extends AbstractMenuBuilder
12
{
13
    public function __construct(
14
        FactoryInterface $factory,
15
        EventDispatcherInterface $eventDispatcher,
16
    ) {
17
        parent::__construct($factory, $eventDispatcher);
18
    }
19
20
    public function getName(): string
21
    {
22
        return 'user';
23
    }
24
25
    protected function buildMenu(ItemInterface $menu): void
26
    {
27
        $menu->addChild('lag_admin.security.logout', [
28
            'route' => 'lag_admin.logout',
29
            'extras' => ['icon' => 'sign-out-alt'],
30
        ]);
31
    }
32
}
33