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

Intl   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
dl 0
loc 74
ccs 12
cts 14
cp 0.8571
rs 10
c 0
b 0
f 0
wmc 6
lcom 1
cbo 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 4 1
A all() 0 4 1
A setLocale() 0 6 1
A getFallbackLocale() 0 4 1
A setFallbackLocale() 0 6 1
A getLocale() 0 4 1
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
}