Completed
Pull Request — master (#34)
by
unknown
03:42
created

Presenter::getCloseTagA()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 7
loc 7
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
namespace Nwidart\Menus\Presenters;
4
5
use Nwidart\Menus\MenuItem;
6
7
abstract class Presenter implements PresenterInterface
8
{
9
    /**
10
     * Get open tag wrapper.
11
     *
12
     * @return string
13
     */
14
    public function getOpenTagWrapper()
15
    {
16
    }
17
18
    /**
19
     * Get close tag wrapper.
20
     *
21
     * @return string
22
     */
23
    public function getCloseTagWrapper()
24
    {
25
26
    }
27
28
    /**
29
     * Get open tag A.
30
     *
31
     * @return string
32
     */
33 View Code Duplication
    public function getOpenTagA($item)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
34
    {
35
        if($item->attributes['vue']){
36
            return PHP_EOL . '<router-link to="' . PHP_EOL;
37
        }
38
        return PHP_EOL . '<a href=">' . PHP_EOL;
39
    }
40
41
    /**
42
     * Get close tag A.
43
     *
44
     * @return string
45
     */
46 View Code Duplication
    public function getCloseTagA($item)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
47
    {
48
        if($item->attributes['vue']){
49
            return PHP_EOL . '</router-link>' . PHP_EOL;
50
        }
51
        return PHP_EOL . '</a>' . PHP_EOL;
52
    }
53
54
55
    /**
56
     * Get menu tag without dropdown wrapper.
57
     *
58
     * @param \Nwidart\Menus\MenuItem $item
59
     *
60
     * @return string
61
     */
62
    public function getMenuWithoutDropdownWrapper($item)
63
    {
64
    }
65
66
    /**
67
     * Get divider tag wrapper.
68
     *
69
     * @return string
70
     */
71
    public function getDividerWrapper()
72
    {
73
    }
74
75
    /**
76
     * Get header dropdown tag wrapper.
77
     *
78
     * @param \Nwidart\Menus\MenuItem $item
79
     *
80
     * @return string
81
     */
82
    public function getHeaderWrapper($item)
83
    {
84
    }
85
86
    /**
87
     * Get menu tag with dropdown wrapper.
88
     *
89
     * @param \Nwidart\Menus\MenuItem $item
90
     *
91
     * @return string
92
     */
93
    public function getMenuWithDropDownWrapper($item)
94
    {
95
    }
96
97
    /**
98
     * Get multi level dropdown menu wrapper.
99
     *
100
     * @param \Nwidart\Menus\MenuItem $item
101
     *
102
     * @return string
103
     */
104
    public function getMultiLevelDropdownWrapper($item)
105
    {
106
    }
107
108
    /**
109
     * Get child menu items.
110
     *
111
     * @param \Nwidart\Menus\MenuItem $item
112
     *
113
     * @return string
114
     */
115
    public function getChildMenuItems(MenuItem $item)
116
    {
117
        $results = '';
118
        foreach ($item->getChilds() as $child) {
119
            if ($child->hidden()) {
120
                continue;
121
            }
122
123
            if ($child->hasSubMenu()) {
124
                $results .= $this->getMultiLevelDropdownWrapper($child);
125
            } elseif ($child->isHeader()) {
126
                $results .= $this->getHeaderWrapper($child);
127
            } elseif ($child->isDivider()) {
128
                $results .= $this->getDividerWrapper();
129
            } else {
130
                $results .= $this->getMenuWithoutDropdownWrapper($child);
131
            }
132
        }
133
134
        return $results;
135
    }
136
}
137