Completed
Push — master ( 0646cc...408e0c )
by Propa
05:16
created

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