Test Failed
Push — master ( 7fb687...840826 )
by Gabriel
12:03
created

LocaleTrait::setLocale()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
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
}