Completed
Push — master ( 59ace0...1e869a )
by Propa
03:14
created

WithLocales::getLocale()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Propaganistas\LaravelIntl\Concerns;
4
5
trait WithLocales
6
{
7
    /**
8
     * The current locale.
9
     *
10
     * @var string $locale
11
     */
12
    protected $locale;
13
14
    /**
15
     * The current locale.
16
     *
17
     * @var string $locale
18
     */
19
    protected $fallbackLocale;
20
21
    /**
22
     * Get the current locale.
23
     *
24
     * @return string
25
     */
26 105
    public function getLocale()
27
    {
28 105
        return $this->locale;
29
    }
30
31
    /**
32
     * Set the current locale.
33
     *
34
     * @param $locale
35
     * @return $this
36
     */
37 105
    public function setLocale($locale)
38
    {
39 105
        $this->locale = $locale;
40
41 105
        return $this;
42
    }
43
44
    /**
45
     * Get the fallback locale.
46
     *
47
     * @return string
48
     */
49 93
    public function getFallbackLocale()
50
    {
51 93
        return $this->fallbackLocale;
52
    }
53
54
    /**
55
     * Set the fallback locale.
56
     *
57
     * @param $locale
58
     * @return $this
59
     */
60 105
    public function setFallbackLocale($locale)
61
    {
62 105
        $this->fallbackLocale = $locale;
63
64 105
        return $this;
65
    }
66
}