Orderable   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A NONE() 0 4 1
A ASC() 0 4 1
A DESC() 0 4 1
A BOTH() 0 4 1
isOrderable() 0 1 ?
1
<?php
2
3
namespace OpenSkill\Datatable\Columns\Orderable;
4
5
/**
6
 * Class Orderable
7
 * @package OpenSkill\Datatable\Columns
8
 *
9
 * Class that indicates the option for the orderable property of a column
10
 */
11
abstract class Orderable
12
{
13
    /**
14
     * Will return an orderable configuration that does not allow ordering.
15
     * @return NoneOrderable
16
     */
17
    public static function NONE()
18
    {
19
        return new NoneOrderable();
20
    }
21
22
    /**
23
     * Will return an orderable configuration that does allow ordering but only on asc.
24
     * @return AscOrderable
25
     */
26
    public static function ASC()
27
    {
28
        return new AscOrderable();
29
    }
30
31
    /**
32
     * Will return an orderable configuration that does allow ordering but only on desc.
33
     * @return DescOrderable
34
     */
35
    public static function DESC()
36
    {
37
        return new DescOrderable();
38
    }
39
40
    /**
41
     * Will return an orderable configuration that does allow ordering on both directions.
42
     * @return BothOrderable
43
     */
44
    public static function BOTH()
45
    {
46
        return new BothOrderable();
47
    }
48
49
    /**
50
     * Will determine if the current configuration allows ordering.
51
     * @return bool True if the column can be ordered, false if not.
52
     */
53
    abstract public function isOrderable();
54
}