Completed
Push — master ( 61d3f4...d36753 )
by Arjay
01:52
created

Config::set()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Yajra\Datatables;
4
5
use Illuminate\Contracts\Config\Repository;
6
7
class Config
8
{
9
    /**
10
     * @var \Illuminate\Contracts\Config\Repository
11
     */
12
    private $repository;
13
14
    /**
15
     * Config constructor.
16
     *
17
     * @param \Illuminate\Contracts\Config\Repository $repository
18
     */
19
    public function __construct(Repository $repository)
20
    {
21
        $this->repository = $repository;
22
    }
23
24
    /**
25
     * Check if config uses wild card search.
26
     *
27
     * @return bool
28
     */
29
    public function isWildcard()
30
    {
31
        return $this->repository->get('datatables.search.use_wildcards', false);
32
    }
33
34
    /**
35
     * Check if config uses smart search.
36
     *
37
     * @return bool
38
     */
39
    public function isSmartSearch()
40
    {
41
        return $this->repository->get('datatables.search.smart', true);
42
    }
43
44
    /**
45
     * Check if config uses case insensitive search.
46
     *
47
     * @return bool
48
     */
49
    public function isCaseInsensitive()
50
    {
51
        return $this->repository->get('datatables.search.case_insensitive', false);
52
    }
53
54
    /**
55
     * Check if app is in debug mode.
56
     *
57
     * @return bool
58
     */
59
    public function isDebugging()
60
    {
61
        return $this->repository->get('app.debug', false);
62
    }
63
64
    /**
65
     * Get the specified configuration value.
66
     *
67
     * @param string $key
68
     * @param mixed  $default
69
     * @return mixed
70
     */
71
    public function get($key, $default = null)
72
    {
73
        return $this->repository->get($key, $default);
74
    }
75
76
    /**
77
     * Set a given configuration value.
78
     *
79
     * @param  array|string $key
80
     * @param  mixed        $value
81
     * @return void
82
     */
83
    public function set($key, $value = null)
84
    {
85
        $this->repository->set($key, $value);
86
    }
87
}
88