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

ZurbMenuPresenter::getActiveState()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 1
nc 2
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 6
rs 10
c 0
b 0
f 0
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