Passed
Push — master ( 8a98a7...504233 )
by Kyle
13:16
created

NavMenuPresenter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 46
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getOpenTagWrapper() 0 3 1
A getMenuWithDropDownWrapper() 0 12 1
A getMultiLevelDropdownWrapper() 0 12 1
1
<?php
2
3
namespace KyleMassacre\Menus\Presenters\Bootstrap;
4
5
class NavMenuPresenter extends NavbarPresenter
6
{
7
    /**
8
     * {@inheritdoc }.
9
     */
10
    public function getOpenTagWrapper()
11
    {
12
        return PHP_EOL . '<ul class="nav navmenu-nav">' . PHP_EOL;
13
    }
14
15
    /**
16
     * {@inheritdoc }.
17
     */
18
    public function getMenuWithDropDownWrapper($item)
19
    {
20
        return '<li class="dropdown' . $this->getActiveStateOnChild($item, ' active open') . '">
21
		          <a href="#" class="dropdown-toggle" data-toggle="dropdown">
22
					' . $item->getIcon() . ' ' . $item->title . '
23
			      	<b class="caret pull-right"></b>
24
			      </a>
25
			      <ul class="dropdown-menu navmenu-nav">
26
			      	' . $this->getChildMenuItems($item) . '
27
			      </ul>
28
		      	</li>'
29
        . PHP_EOL;
30
    }
31
32
    /**
33
     * Get multilevel menu wrapper.
34
     *
35
     * @param \KyleMassacre\Menus\MenuItem $item
36
     *
37
     * @return string`
0 ignored issues
show
Documentation Bug introduced by
The doc comment string` at position 0 could not be parsed: Unknown type name 'string`' at position 0 in string`.
Loading history...
38
     */
39
    public function getMultiLevelDropdownWrapper($item)
40
    {
41
        return '<li class="dropdown' . $this->getActiveStateOnChild($item, ' active open') . '">
42
		          <a href="#" class="dropdown-toggle" data-toggle="dropdown">
43
					' . $item->getIcon() . ' ' . $item->title . '
44
			      	<b class="caret pull-right caret-right"></b>
45
			      </a>
46
			      <ul class="dropdown-menu navmenu-nav">
47
			      	' . $this->getChildMenuItems($item) . '
48
			      </ul>
49
		      	</li>'
50
        . PHP_EOL;
51
    }
52
}
53