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

Searchable::EXACT()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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
}