HasInternationalisation::languageDecimal()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Yajra\DataTables\Html\Options;
4
5
use Yajra\DataTables\Html\Options\Languages;
6
7
/**
8
 * DataTables - Internationalisation option builder.
9
 *
10
 * @see https://datatables.net/reference/option/
11
 */
12
trait HasInternationalisation
13
{
14
    use Languages\Aria;
15
    use Languages\AutoFill;
16
    use Languages\Paginate;
17
    use Languages\Select;
18
19
    /**
20
     * Set language option value.
21
     *
22
     * @param string|array $value
23
     * @return $this
24
     * @see https://datatables.net/reference/option/language
25
     */
26 View Code Duplication
    public function language($value)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28
        if (is_array($value)) {
29
            $this->attributes['language'] = $value;
0 ignored issues
show
Bug introduced by
The property attributes does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
30
        } else {
31
            $this->attributes['language']['url'] = $value;
32
        }
33
34
        return $this;
35
    }
36
37
    /**
38
     * Set language decimal option value.
39
     *
40
     * @param string $value
41
     * @return $this
42
     * @see https://datatables.net/reference/option/language.decimal
43
     */
44
    public function languageDecimal($value)
45
    {
46
        $this->attributes['language']['decimal'] = $value;
47
48
        return $this;
49
    }
50
51
    /**
52
     * Set language emptyTable option value.
53
     *
54
     * @param string $value
55
     * @return $this
56
     * @see https://datatables.net/reference/option/language.emptyTable
57
     */
58
    public function languageEmptyTable($value)
59
    {
60
        $this->attributes['language']['emptyTable'] = $value;
61
62
        return $this;
63
    }
64
65
    /**
66
     * Set language info option value.
67
     *
68
     * @param string $value
69
     * @return $this
70
     * @see https://datatables.net/reference/option/language.info
71
     */
72
    public function languageInfo($value)
73
    {
74
        $this->attributes['language']['info'] = $value;
75
76
        return $this;
77
    }
78
79
    /**
80
     * Set language infoEmpty option value.
81
     *
82
     * @param string $value
83
     * @return $this
84
     * @see https://datatables.net/reference/option/language.infoEmpty
85
     */
86
    public function languageInfoEmpty($value)
87
    {
88
        $this->attributes['language']['infoEmpty'] = $value;
89
90
        return $this;
91
    }
92
93
    /**
94
     * Set language infoFiltered option value.
95
     *
96
     * @param string $value
97
     * @return $this
98
     * @see https://datatables.net/reference/option/language.infoFiltered
99
     */
100
    public function languageInfoFiltered($value)
101
    {
102
        $this->attributes['language']['infoFiltered'] = $value;
103
104
        return $this;
105
    }
106
107
    /**
108
     * Set language infoPostFix option value.
109
     *
110
     * @param string $value
111
     * @return $this
112
     * @see https://datatables.net/reference/option/language.infoPostFix
113
     */
114
    public function languageInfoPostFix($value)
115
    {
116
        $this->attributes['language']['infoPostFix'] = $value;
117
118
        return $this;
119
    }
120
121
    /**
122
     * Set language lengthMenu option value.
123
     *
124
     * @param string $value
125
     * @return $this
126
     * @see https://datatables.net/reference/option/language.lengthMenu
127
     */
128
    public function languageLengthMenu($value)
129
    {
130
        $this->attributes['language']['lengthMenu'] = $value;
131
132
        return $this;
133
    }
134
135
    /**
136
     * Set language loadingRecords option value.
137
     *
138
     * @param string $value
139
     * @return $this
140
     * @see https://datatables.net/reference/option/language.loadingRecords
141
     */
142
    public function languageLoadingRecords($value)
143
    {
144
        $this->attributes['language']['loadingRecords'] = $value;
145
146
        return $this;
147
    }
148
149
    /**
150
     * Set language processing option value.
151
     *
152
     * @param string $value
153
     * @return $this
154
     * @see https://datatables.net/reference/option/language.processing
155
     */
156
    public function languageProcessing($value)
157
    {
158
        $this->attributes['language']['processing'] = $value;
159
160
        return $this;
161
    }
162
163
    /**
164
     * Set language search option value.
165
     *
166
     * @param string $value
167
     * @return $this
168
     * @see https://datatables.net/reference/option/language.search
169
     */
170
    public function languageSearch($value)
171
    {
172
        $this->attributes['language']['search'] = $value;
173
174
        return $this;
175
    }
176
177
    /**
178
     * Set language searchPlaceholder option value.
179
     *
180
     * @param string $value
181
     * @return $this
182
     * @see https://datatables.net/reference/option/language.searchPlaceholder
183
     */
184
    public function languageSearchPlaceholder($value)
185
    {
186
        $this->attributes['language']['searchPlaceholder'] = $value;
187
188
        return $this;
189
    }
190
191
    /**
192
     * Set language thousands option value.
193
     *
194
     * @param string $value
195
     * @return $this
196
     * @see https://datatables.net/reference/option/language.thousands
197
     */
198
    public function languageThousands($value)
199
    {
200
        $this->attributes['language']['thousands'] = $value;
201
202
        return $this;
203
    }
204
205
    /**
206
     * Set language url option value.
207
     *
208
     * @param string $value
209
     * @return $this
210
     * @see https://datatables.net/reference/option/language.url
211
     */
212
    public function languageUrl($value)
213
    {
214
        $this->attributes['language']['url'] = $value;
215
216
        return $this;
217
    }
218
219
    /**
220
     * Set language zeroRecords option value.
221
     *
222
     * @param string $value
223
     * @return $this
224
     * @see https://datatables.net/reference/option/language.zeroRecords
225
     */
226
    public function languageZeroRecords($value)
227
    {
228
        $this->attributes['language']['zeroRecords'] = $value;
229
230
        return $this;
231
    }
232
}
233