Seo   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 54
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfig() 0 6 2
A setConfig() 0 4 1
A getTrans() 0 4 1
1
<?php namespace Arcanedev\LaravelSeo;
2
3
/**
4
 * Class     Seo
5
 *
6
 * @package  Arcanedev\LaravelSeo
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class Seo
10
{
11
    /* -----------------------------------------------------------------
12
     |  Constants
13
     | -----------------------------------------------------------------
14
     */
15
16
    const KEY = 'laravel-seo';
17
18
    /* -----------------------------------------------------------------
19
     |  Main Methods
20
     | -----------------------------------------------------------------
21
     */
22
23
    /**
24
     * Get the seo config.
25
     *
26
     * @param  string|null  $key
27
     * @param  mixed|null   $default
28
     *
29
     * @return mixed
30
     */
31 58
    public static function getConfig($key = null, $default = null)
32
    {
33 58
        $key = self::KEY.(is_null($key) ? '' : '.'.$key);
34
35 58
        return config()->get($key, $default);
36
    }
37
38
    /**
39
     * Set the seo config.
40
     *
41
     * @param  string      $key
42
     * @param  mixed|null  $value
43
     */
44 58
    public static function setConfig($key, $value = null)
45
    {
46 58
        config()->set(self::KEY.'.'.$key, $value);
47 58
    }
48
49
    /**
50
     * Get the seo translation.
51
     *
52
     * @param  string  $key
53
     * @param  array   $replace
54
     * @param  string  $locale
55
     *
56
     * @return string
57
     */
58 8
    public static function getTrans($key = null, $replace = [], $locale = null)
59
    {
60 8
        return trans(self::KEY.'::'.$key, $replace, $locale);
61
    }
62
}
63