Completed
Push — master ( 8b59f7...62ee86 )
by Arjay
01:32
created

Select   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 58
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A languageSelect() 0 6 1
A languageSelectCells() 0 6 1
A languageSelectColumns() 0 6 1
A languageSelectRows() 0 6 1
1
<?php
2
3
namespace Yajra\DataTables\Html\Options\Languages;
4
5
trait Select
6
{
7
    /**
8
     * Set language select option value.
9
     *
10
     * @param array $value
11
     * @return $this
12
     * @see https://datatables.net/reference/option/language.select
13
     */
14
    public function languageSelect($value)
15
    {
16
        $this->attributes['language']['select'] = $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...
17
18
        return $this;
19
    }
20
21
    /**
22
     * Set language select cells option value.
23
     *
24
     * @param string|array $value
25
     * @return $this
26
     * @see https://datatables.net/reference/option/language.select.cells
27
     */
28
    public function languageSelectCells($value)
29
    {
30
        $this->attributes['language']['select']['cells'] = $value;
31
32
        return $this;
33
    }
34
35
    /**
36
     * Set language select columns option value.
37
     *
38
     * @param string|array $value
39
     * @return $this
40
     * @see https://datatables.net/reference/option/language.select.columns
41
     */
42
    public function languageSelectColumns($value)
43
    {
44
        $this->attributes['language']['select']['columns'] = $value;
45
46
        return $this;
47
    }
48
49
    /**
50
     * Set language select rows option value.
51
     *
52
     * @param string|array $value
53
     * @return $this
54
     * @see https://datatables.net/reference/option/language.select.rows
55
     */
56
    public function languageSelectRows($value)
57
    {
58
        $this->attributes['language']['select']['rows'] = $value;
59
60
        return $this;
61
    }
62
}
63