LocaleTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 32
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getLocale() 0 10 2
A setLocale() 0 3 1
1
<?php
2
3
namespace ByTIC\Money\Traits;
4
5
/**
6
 * Trait LocaleTrait
7
 * @package ByTIC\Money\Traits
8
 */
9
trait LocaleTrait
10
{
11
    /**
12
     * @var string
13
     */
14
    protected static $locale;
15
16
    /**
17
     * Get locale.
18
     *
19
     * @return string
20
     */
21
    public static function getLocale()
22
    {
23
        if (!isset(static::$locale)) {
24
            static::setLocale(
25
                'en_US'
26
//                config('money.locale', 'en_US')
27
            );
28
        }
29
30
        return static::$locale;
31
    }
32
33
    /**
34
     * Set locale.
35
     *
36
     * @param string $locale
37
     */
38
    public static function setLocale($locale)
39
    {
40
        static::$locale = $locale;
41
    }
42
}