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

ControllerResourceRoute::obtainReplacements()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 7
loc 7
rs 9.4285
cc 1
eloc 4
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 ControllerResourceRoute.
10
 *
11
 * @package Acacha\AdminLTETemplateLaravel\Console
12
 */
13 View Code Duplication
class ControllerResourceRoute 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_resource_controller.stub';
36
    }
37
38
    /**
39
     * Obtain replacements for stub.
40
     *
41
     * @return mixed
42
     */
43
    protected function obtainReplacements()
44
    {
45
        return [
46
            'ROUTE_LINK' => $this->getReplacements()[0],
47
            'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[1]),
48
        ];
49
    }
50
}
51