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

LanguageFile   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 42
ccs 0
cts 20
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getSingular() 0 4 1
A getPlural() 0 4 1
A getFileName() 0 4 1
A getPath() 0 4 1
1
<?php
2
3
namespace Webfactor\Laravel\Generators\Schemas\Naming;
4
5
use Carbon\Carbon;
6
use Webfactor\Laravel\Generators\Contracts\NamingAbstract;
7
8
class LanguageFile extends NamingAbstract
9
{
10
    /**
11
     * @return string
12
     */
13
    public function getName(): string
14
    {
15
        return snake_case($this->entity);
16
    }
17
18
    /**
19
     * @return string
20
     */
21
    public function getSingular(): string
22
    {
23
        return ucfirst($this->entity);
24
    }
25
26
    /**
27
     * @return string
28
     */
29
    public function getPlural(): string
30
    {
31
        return ucfirst(str_plural($this->entity));
32
    }
33
34
    /**
35
     * @return string
36
     */
37
    public function getFileName(): string
38
    {
39
        return 'models.php';
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getPath(): string
46
    {
47
        return resource_path('lang/' . \Lang::locale());
48
    }
49
}
50