Completed
Push — master ( 800114...d023f1 )
by ARCANEDEV
04:49
created

Locales::all()   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
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php namespace Arcanesoft\Seo\Entities;
2
3
use Illuminate\Support\Collection;
4
5
/**
6
 * Class     Locales
7
 *
8
 * @package  Arcanesoft\Seo\Entities
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class Locales
12
{
13
    /* -----------------------------------------------------------------
14
     |  Main Methods
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Get all the supported locales.
20
     *
21
     * @return \Illuminate\Support\Collection
22
     */
23 16
    public static function all()
24
    {
25 16
        return new Collection(trans("seo::locales"));
26
    }
27
28
    /**
29
     * Get all the supported locales keys.
30
     *
31
     * @return \Illuminate\Support\Collection
32
     */
33 4
    public static function keys()
34
    {
35 4
        return static::all()->keys();
36
    }
37
38
    /**
39
     * Get a supported locale by its key.
40
     *
41
     * @param  string       $key
42
     * @param  string|null  $default
43
     *
44
     * @return string|null
45
     */
46 8
    public static function get($key, $default = null)
47
    {
48 8
        return static::all()->get($key, $default);
49
    }
50
}
51