Passed
Pull Request — master (#57)
by Kyle
08:10
created

NavbarRightPresenter::getOpenTagWrapper()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace KyleMassacre\Menus\Presenters\Bootstrap;
4
5
use KyleMassacre\Menus\Contracts\MenuItemContract;
6
7
class NavbarRightPresenter extends NavbarPresenter
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    public function getOpenTagWrapper(): ?string
13
    {
14
        return PHP_EOL . '<ul class="nav navbar-nav navbar-right">' . PHP_EOL;
15
    }
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function getMenuWithDropDownWrapper(MenuItemContract $item): ?string
21
    {
22
        return '<li class="dropdown pull-right">
23
			      <a href="#" class="dropdown-toggle" data-toggle="dropdown">
24
					' . $item->getIcon() . ' ' . $item->title . '
0 ignored issues
show
Bug introduced by
The call to KyleMassacre\Menus\Contr...ItemContract::getIcon() has too few arguments starting with default. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
					' . $item->/** @scrutinizer ignore-call */ getIcon() . ' ' . $item->title . '

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Bug Best Practice introduced by
The property title does not exist on KyleMassacre\Menus\Contracts\MenuItemContract. Since you implemented __get, consider adding a @property annotation.
Loading history...
25
			      	<b class="caret"></b>
26
			      </a>
27
			      <ul class="dropdown-menu">
28
			      	' . $this->getChildMenuItems($item) . '
29
			      </ul>
30
		      	</li>'
31
        . PHP_EOL;
32
    }
33
}
34