CrudRequest::getPath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Webfactor\Laravel\Generators\Schemas\Naming;
4
5
use Webfactor\Laravel\Generators\Contracts\NamingAbstract;
6
7 View Code Duplication
class CrudRequest extends NamingAbstract
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...
8
{
9
    private $path = 'Http/Requests/Admin';
10
11
    /**
12
     * @return string
13
     */
14
    public function getNamespace(): string
15
    {
16
        return $this->getAppNamespace() . 'Http\\Requests\\Admin';
17
    }
18
19
    /**
20
     * @return string
21
     */
22
    public function getClassName(): string
23
    {
24
        return ucfirst($this->entity) . 'Request';
25
    }
26
27
    /**
28
     * @return string
29
     */
30
    public function getFileName(): string
31
    {
32
        return $this->getClassName() . '.php';
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getPath(): string
39
    {
40
        return app_path($this->path);
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getRelativeFilePath(): string
47
    {
48
        return str_replace("\\", '/', $this->getAppNamespace()).$this->path.'/'.$this->getFileName();
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function getStub(): string
55
    {
56
        return __DIR__ . '/../../../stubs/crud-request.stub';
57
    }
58
}
59