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

ZurbMenuPresenter   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 67
ccs 0
cts 21
cp 0
rs 10
c 0
b 0
f 0
wmc 8

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getOpenTagWrapper() 0 4 1
A getActiveState() 0 3 2
A getMenuWithDropDownWrapper() 0 8 1
A getDividerWrapper() 0 3 1
A getCloseTagWrapper() 0 3 1
A getMenuWithoutDropdownWrapper() 0 3 1
A getMultiLevelDropdownWrapper() 0 8 1
1
<?php
2
3
namespace KyleMassacre\Menus\Presenters\Foundation;
4
5
use KyleMassacre\Menus\Presenters\Presenter;
6
7
class ZurbMenuPresenter extends Presenter
8
{
9
    /**
10
     * {@inheritdoc }
11
     */
12
    public function getOpenTagWrapper()
13
    {
14
        return  PHP_EOL . '<nav class="custom-main">
15
        <ul class="dropdown menu" data-dropdown-menu>' . PHP_EOL;
16
    }
17
18
    /**
19
     * {@inheritdoc }
20
     */
21
    public function getCloseTagWrapper()
22
    {
23
        return  PHP_EOL . '</ul></nav>' . PHP_EOL;
24
    }
25
26
    /**
27
     * {@inheritdoc }
28
     */
29
    public function getMenuWithoutDropdownWrapper($item)
30
    {
31
        return '<li' . $this->getActiveState($item) . '><a href="' . $item->getUrl() . '">' . $item->title . '</a></li>';
32
    }
33
34
    /**
35
     * {@inheritdoc }
36
     */
37
    public function getActiveState($item)
38
    {
39
        return \Request::is($item->getRequest()) ? ' class="is-active"' : null;
40
    }
41
42
    /**
43
     * {@inheritdoc }
44
     */
45
    public function getDividerWrapper()
46
    {
47
        return '<li class="divider"></li>';
48
    }
49
50
    /**
51
     * {@inheritdoc }
52
     */
53
    public function getMenuWithDropDownWrapper($item)
54
    {
55
        return '<li class="dropdown dropdown-primary">
56
                    <a class="dropdown-toggle" href="#">' . $item->title . '</a>
57
                    <ul class="menu">
58
                      ' . $this->getChildMenuItems($item) . '
59
                    </ul>
60
                </li>' . PHP_EOL;
61
    }
62
63
    /**
64
     * {@inheritdoc }
65
     */
66
    public function getMultiLevelDropdownWrapper($item)
67
    {
68
        return '<li>
69
                  <a href="#">' . $item->title . '</a>
70
                  <ul class="menu">
71
                    ' . $this->getChildMenuItems($item) . '
72
                  </ul>
73
                </li>' . PHP_EOL;
74
    }
75
}
76