GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 890c9c...35b399 )
by
unknown
02:03
created

Menu::createItem()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the O2System Framework package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author         Steeve Andrian Salim
9
 * @copyright      Copyright (c) Steeve Andrian Salim
10
 */
11
12
// ------------------------------------------------------------------------
13
14
namespace O2System\Framework\Libraries\Ui\Admin\Sidebar;
15
16
// ------------------------------------------------------------------------
17
18
use O2System\Framework\Libraries\Ui\Admin\Sidebar\Menu\UnorderedList;
19
use O2System\Framework\Libraries\Ui\Element;
20
21
/**
22
 * Class Menu
23
 * @package O2System\Framework\Libraries\Ui\Admin\Sidebar
24
 */
25
class Menu extends Element
26
{
27
    /**
28
     * Menu::$list
29
     *
30
     * @var \O2System\Framework\Libraries\Ui\Admin\Sidebar\Menu\UnorderedList
31
     */
32
    public $list;
33
34
    // ------------------------------------------------------------------------
35
36
    /**
37
     * Code::__construct
38
     *
39
     * @param array $attributes
40
     */
41
    public function __construct(array $attributes = [])
42
    {
43
        parent::__construct('div');
44
45
        if (isset($attributes[ 'id' ])) {
46
            $this->entity->setEntityName($attributes[ 'id' ]);
47
        }
48
49
        if (count($attributes)) {
50
            foreach ($attributes as $name => $value) {
51
                $this->attributes->addAttribute($name, $value);
52
            }
53
        }
54
55
        $this->attributes->addAttributeClass('sidebar-menu');
56
57
        $this->list = new UnorderedList();
58
59
        $this->childNodes->push($this->list);
60
    }
61
62
    // ------------------------------------------------------------------------
63
64
    /**
65
     * Menu::createTitle
66
     *
67
     * @param string $title
68
     *
69
     * @return \O2System\Framework\Libraries\Ui\Contents\Lists\Item
70
     */
71
    public function createTitle($title)
72
    {
73
        $item = $this->list->createList($title);
74
        $item->attributes->addAttributeClass('menu-title');
75
76
        return $item;
77
    }
78
79
    // ------------------------------------------------------------------------
80
81
    /**
82
     * Menu::createItem
83
     *
84
     * @param mixed $item
85
     */
86
    public function createItem($item)
87
    {
88
        $item = $this->list->createList($item);
0 ignored issues
show
Unused Code introduced by
The assignment to $item is dead and can be removed.
Loading history...
89
    }
90
}