Passed
Push — master ( 1f7f34...948e88 )
by Thomas
04:12 queued 02:03
created

SidebarService::getRouteString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 11
ccs 0
cts 10
cp 0
crap 2
rs 9.9
c 0
b 0
f 0
1
<?php
2
3
namespace Webfactor\Laravel\Generators\Services;
4
5
use Illuminate\Filesystem\Filesystem;
6
use Webfactor\Laravel\Generators\Commands\MakeEntity;
7
use Webfactor\Laravel\Generators\Contracts\ServiceAbstract;
8
use Webfactor\Laravel\Generators\Contracts\ServiceInterface;
9
10
class SidebarService extends ServiceAbstract implements ServiceInterface
11
{
12
    protected $key = 'sidebar';
13
14 View Code Duplication
    public function call()
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...
15
    {
16
        $sidebarFile = $this->naming->getFile();
17
18
        if ($this->filesystem->exists($sidebarFile)) {
19
            $this->filesystem->append($sidebarFile, $this->getSidebarString());
20
            $this->addGeneratedFileToIdeStack();
21
        }
22
    }
23
24
    private function getSidebarString()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
25
    {
26
        return <<<FILE
27
28
<li>
29
    <a href="{{ backpack_url('{$this->command->naming['routeFile']->getName()}') }}">
30
        <i class="fa fa-question"></i><span>{{ trans('models.{$this->command->naming['languageFile']->getName()}.plural') }}</span>
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 131 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
31
    </a>
32
</li>
33
FILE;
34
    }
35
}
36