Completed
Push — master ( 18b88e...f20694 )
by Tim
04:27 queued 02:13
created

Searchable   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 5
Bugs 0 Features 4
Metric Value
wmc 5
c 5
b 0
f 4
lcom 0
cbo 5
dl 0
loc 57
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A NONE() 0 4 1
A NORMAL() 0 4 1
A REGEX() 0 4 1
A EXACT() 0 4 1
A NOTIMPLEMENTED() 0 4 1
isSearchable() 0 1 ?
1
<?php
2
3
namespace OpenSkill\Datatable\Columns\Searchable;
4
5
/**
6
 * Class Searchable
7
 * @package OpenSkill\Datatable\Columns
8
 *
9
 * Enum class that indicates the search option for the column
10
 */
11
abstract class Searchable
12
{
13
14
    /**
15
     * Will construct a new searchable instance that is not searchable and is not regex searchable.
16
     * @return NoneSearchable
17
     */
18
    public static function NONE()
19
    {
20
        return new NoneSearchable();
21
    }
22
23
    /**
24
     * Will construct a new searchable that will allow normal searching but not regex searching.
25
     * @return DefaultSearchable
26
     */
27
    public static function NORMAL()
28
    {
29
        return new DefaultSearchable();
30
    }
31
32
    /**
33
     * Will return a new searchable that will allow normal searching which also allows regex searching.
34
     * @return RegexSearchable
35
     */
36
    public static function REGEX()
37
    {
38
        return new RegexSearchable();
39
    }
40
41
    /**
42
     * Will return a new searchable that will allow for an exact match.
43
     * @return ExactSearchable
44
     */
45
    public static function EXACT()
46
    {
47
        return new ExactSearchable();
48
    }
49
50
    /**
51
     * Will return a new searchable that is not implemented.
52
     *
53
     * This is used for unit testing. Nothing to see here.
54
     *
55
     * @return NotImplementedSearchable
56
     */
57
    public static function NOTIMPLEMENTED()
58
    {
59
        return new NotImplementedSearchable();
60
    }
61
62
    /**
63
     * Will return if this configuration allows searching on the column.
64
     * @return bool
65
     */
66
    abstract public function isSearchable();
67
}