Locales   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 40
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 4 1
A keys() 0 4 1
A get() 0 4 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 8
    public static function all()
24
    {
25 8
        return new Collection(trans('seo::locales'));
26
    }
27
28
    /**
29
     * Get all the supported locales keys.
30
     *
31
     * @return \Illuminate\Support\Collection
32
     */
33 2
    public static function keys()
34
    {
35 2
        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 4
    public static function get($key, $default = null)
47
    {
48 4
        return static::all()->get($key, $default);
49
    }
50
}
51