HasUralicVerboseMethods   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 40
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
getTranslationIn() 0 1 ?
A inEstonian() 0 4 1
A inFinnish() 0 4 1
A inHungarian() 0 4 1
1
<?php
2
3
namespace ChinLeung\VerboseLocalization\Concerns;
4
5
trait HasUralicVerboseMethods
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 Estonian.
17
     *
18
     * @return mixed
19
     */
20
    public function inEstonian()
21
    {
22
        return $this->getTranslationIn('et');
23
    }
24
25
    /**
26
     * Function to retrieve the translation in Finnish.
27
     *
28
     * @return mixed
29
     */
30
    public function inFinnish()
31
    {
32
        return $this->getTranslationIn('fi');
33
    }
34
35
    /**
36
     * Function to retrieve the translation in Hungarian.
37
     *
38
     * @return mixed
39
     */
40
    public function inHungarian()
41
    {
42
        return $this->getTranslationIn('hu');
43
    }
44
}
45