Completed
Push — master ( a9cf09...3ef192 )
by Propa
06:24
created

Intl::getFallbackLocale()   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 namespace Propaganistas\LaravelIntl\Base;
2
3
use Propaganistas\LaravelIntl\Interfaces\IntlInterface;
4
5
class Intl implements IntlInterface
6
{
7
    use LocaleCallback;
8
9
    /**
10
     * @var mixed
11
     */
12
    protected $data;
13
14
    /**
15
     * Get a localized entry.
16
     *
17
     * @param string $code
18
     * @return mixed
19
     */
20 48
    public function get($code)
21
    {
22 48
        return $this->data->get($code);
23
    }
24
25
    /**
26
     * Get a localized list of entries, keyed by their code.
27
     *
28
     * @return array
29
     */
30 6
    public function all()
31
    {
32 6
        return $this->data->getList();
33
    }
34
35
    /**
36
     * Get the default locale.
37
     *
38
     * @return string
39
     */
40 16
    public function getLocale()
41
    {
42 16
        return $this->data->getDefaultLocale();
43
    }
44
45
    /**
46
     * Set the default locale.
47
     *
48
     * @param string $locale
49
     * @return $this
50
     */
51 53
    public function setLocale($locale)
52
    {
53 38
        $this->data->setDefaultLocale($locale);
54
55 53
        return $this;
56
    }
57
58
    /**
59
     * Get the fallback locale.
60
     *
61
     * @return string
62
     */
63 8
    public function getFallbackLocale()
64
    {
65 8
        return $this->data->getFallbackLocale();
66
    }
67
68
    /**
69
     * Set the desired locale.
70
     *
71
     * @param string $locale
72
     * @return $this
73
     */
74 20
    public function setFallbackLocale($locale)
75
    {
76 16
        $this->data->setFallbackLocale($locale);
77
78 20
        return $this;
79
    }
80
}