Completed
Push — master ( d6c0d3...fbf2bc )
by Sergi Tur
03:14
created

ControllerRoute::getStubPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Acacha\AdminLTETemplateLaravel\Console\Routes;
4
5
use Acacha\AdminLTETemplateLaravel\Compiler\StubFileCompiler;
6
use Acacha\AdminLTETemplateLaravel\Filesystem\Filesystem;
7
8
/**
9
 * Class ControllerRoute.
10
 *
11
 * @package Acacha\AdminLTETemplateLaravel\Console
12
 */
13 View Code Duplication
class ControllerRoute extends Route
0 ignored issues
show
Duplication introduced by
This class 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...
14
{
15
    use Controller;
16
17
    /**
18
     * Route constructor.
19
     *
20
     * @param StubFileCompiler $compiler
21
     * @param Filesystem $filesystem
22
     */
23
    public function __construct(StubFileCompiler $compiler,Filesystem $filesystem)
24
    {
25
        parent::__construct($compiler,$filesystem);
26
    }
27
28
    /**
29
     * Get stub path.
30
     *
31
     * @return mixed
32
     */
33
    protected function getStubPath()
34
    {
35
        return __DIR__ . '/../stubs/route_with_controller.stub';
36
    }
37
38
    /**
39
     * Obtain replacements.
40
     *
41
     * @return array
42
     */
43
    protected function obtainReplacements()
44
    {
45
        return [
46
            'ROUTE_LINK' => $this->getReplacements()[0],
47
            'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[1]),
48
            'ROUTE_METHOD' => $this->getReplacements()[2],
49
        ];
50
    }
51
52
}
53