HasGermanicVerboseMethods   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 120
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 11
lcom 1
cbo 0
dl 0
loc 120
rs 10
c 0
b 0
f 0

12 Methods

Rating   Name   Duplication   Size   Complexity  
getTranslationIn() 0 1 ?
A inAfrikaans() 0 4 1
A inDanish() 0 4 1
A inDutch() 0 4 1
A inEnglish() 0 4 1
A inFrisian() 0 4 1
A inGerman() 0 4 1
A inIcelandic() 0 4 1
A inLuxembourgish() 0 4 1
A inNorwegian() 0 4 1
A inYiddish() 0 4 1
A inSwedish() 0 4 1
1
<?php
2
3
namespace ChinLeung\VerboseLocalization\Concerns;
4
5
trait HasGermanicVerboseMethods
6
{
7
    /**
8
     * Retrieve the translation in another locale.
9
     *
10
     * @param  string  $locale
11
     * @return mixed
12
     */
13
    abstract public function getTranslationIn(string $locale);
14
15
    /**
16
     * Function to retrieve the translation in Afrikaans.
17
     *
18
     * @return mixed
19
     */
20
    public function inAfrikaans()
21
    {
22
        return $this->getTranslationIn('af');
23
    }
24
25
    /**
26
     * Function to retrieve the translation in Danish.
27
     *
28
     * @return mixed
29
     */
30
    public function inDanish()
31
    {
32
        return $this->getTranslationIn('da');
33
    }
34
35
    /**
36
     * Function to retrieve the translation in Dutch.
37
     *
38
     * @return mixed
39
     */
40
    public function inDutch()
41
    {
42
        return $this->getTranslationIn('nl');
43
    }
44
45
    /**
46
     * Function to retrieve the translation in English.
47
     *
48
     * @return mixed
49
     */
50
    public function inEnglish()
51
    {
52
        return $this->getTranslationIn('en');
53
    }
54
55
    /**
56
     * Function to retrieve the translation in Frisian.
57
     *
58
     * @return mixed
59
     */
60
    public function inFrisian()
61
    {
62
        return $this->getTranslationIn('fy');
63
    }
64
65
    /**
66
     * Function to retrieve the translation in German.
67
     *
68
     * @return mixed
69
     */
70
    public function inGerman()
71
    {
72
        return $this->getTranslationIn('de');
73
    }
74
75
    /**
76
     * Function to retrieve the translation in Icelandic.
77
     *
78
     * @return mixed
79
     */
80
    public function inIcelandic()
81
    {
82
        return $this->getTranslationIn('is');
83
    }
84
85
    /**
86
     * Function to retrieve the translation in Luxembourgish.
87
     *
88
     * @return mixed
89
     */
90
    public function inLuxembourgish()
91
    {
92
        return $this->getTranslationIn('lb');
93
    }
94
95
    /**
96
     * Function to retrieve the translation in Norwegian.
97
     *
98
     * @return mixed
99
     */
100
    public function inNorwegian() : string
101
    {
102
        return $this->getTranslationIn('no');
103
    }
104
105
    /**
106
     * Function to retrieve the translation in Yiddish.
107
     *
108
     * @return mixed
109
     */
110
    public function inYiddish() : string
111
    {
112
        return $this->getTranslationIn('yi');
113
    }
114
115
    /**
116
     * Function to retrieve the translation in Swedish.
117
     *
118
     * @return mixed
119
     */
120
    public function inSwedish() : string
121
    {
122
        return $this->getTranslationIn('sv');
123
    }
124
}
125