ColumnOrder   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A columnName() 0 4 1
A isAscending() 0 4 1
A isDescending() 0 4 1
1
<?php
2
3
namespace OpenSkill\Datatable\Columns;
4
5
class ColumnOrder
6
{
7
8
    /** @var string */
9
    private $columnName;
10
11
    /** @var bool */
12
    private $isAscOrdering;
13
14
    /**
15
     * ColumnOrder constructor.
16
     * @param string $columnName the internal name of the column
17
     * @param bool $isAscOrdering true if the ordering is ascending
18
     */
19
    public function __construct($columnName, $isAscOrdering)
20
    {
21
        $this->columnName = $columnName;
22
        $this->isAscOrdering = $isAscOrdering;
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function columnName()
29
    {
30
        return $this->columnName;
31
    }
32
33
    /**
34
     * @return bool
35
     */
36
    public function isAscending()
37
    {
38
        return $this->isAscOrdering;
39
    }
40
41
    /**
42
     * @return bool
43
     */
44
    public function isDescending()
45
    {
46
        return !$this->isAscOrdering;
47
    }
48
}