Setting::buildMenu()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 4
Bugs 0 Features 2
Metric Value
c 4
b 0
f 2
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * AnimeDb package
4
 *
5
 * @package   AnimeDb
6
 * @author    Peter Gribanov <[email protected]>
7
 * @copyright Copyright (c) 2011, Peter Gribanov
8
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
9
 */
10
11
namespace AnimeDb\Bundle\MyAnimeListSyncBundle\Service;
12
13
use AnimeDb\Bundle\CatalogBundle\Plugin\Setting\Setting as SettingPlugin;
14
use Knp\Menu\ItemInterface;
15
16
/**
17
 * Setting plugin
18
 *
19
 * @package AnimeDb\Bundle\MyAnimeListSyncBundle\Service
20
 * @author  Peter Gribanov <[email protected]>
21
 */
22
class Setting extends SettingPlugin
23
{
24
    /**
25
     * @return string
26
     */
27
    public function getName()
28
    {
29
        return 'my-anime-list';
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getTitle()
36
    {
37
        return 'MyAnimeList Sync';
38
    }
39
40
    /**
41
     * @param ItemInterface $item
42
     *
43
     * @return ItemInterface
44
     */
45
    public function buildMenu(ItemInterface $item)
46
    {
47
        $item->addChild('MyAnimeList', ['route' => 'my_anime_list_sync_settings'])
48
            ->setLinkAttribute('class', 'icon-label icon-label-plugin-my-anime-list');
49
    }
50
}
51