Builder::appendTo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 21
rs 9.8666
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Veslo project <https://github.com/symfony-doge/veslo>.
5
 *
6
 * (C) 2019 Pavel Petrov <[email protected]>.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @license https://opensource.org/licenses/GPL-3.0 GPL-3.0
12
 */
13
14
declare(strict_types=1);
15
16
namespace Veslo\AnthillBundle\Menu;
17
18
use Knp\Menu\ItemInterface;
19
use Veslo\AnthillBundle\Enum\Route;
20
21
/**
22
 * Anthill bundle menu builder
23
 */
24
class Builder
25
{
26
    /**
27
     * Appends bundle-specific items to root of application menu
28
     *
29
     * @param ItemInterface $root Root item of application menu tree
30
     *
31
     * @return void
32
     */
33
    public function appendTo(ItemInterface $root): void
34
    {
35
        $root->addChild(
36
            'homepage',
37
            [
38
                'route'  => 'anthill_vacancy_index',
39
                'extras' => [
40
                    'translation_domain' => 'menu',
41
                ],
42
            ]
43
        );
44
45
        $root->addChild(
46
            'archive',
47
            [
48
                'route'  => Route::VACANCY_ARCHIVE,
49
                'extras' => [
50
                    'routes'             => [
51
                        ['route' => Route::VACANCY_ARCHIVE_PAGE],
52
                    ],
53
                    'translation_domain' => 'menu',
54
                ],
55
            ]
56
        );
57
    }
58
}
59