Completed
Pull Request — master (#12)
by
unknown
11:33
created

PercentDataType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 39
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultFilterMethod() 0 4 1
A getName() 0 4 1
A getAvailableFilterMethods() 0 11 1
1
<?php
2
3
namespace Netdudes\DataSourceryBundle\DataType;
4
5
use Netdudes\DataSourceryBundle\Query\FilterCondition;
6
7
class PercentDataType extends AbstractDataType
8
{
9
    /**
10
     * Return the identifier of the default sort method.
11
     *
12
     * @return int
13
     */
14
    public function getDefaultFilterMethod()
15
    {
16
        return FilterCondition::METHOD_NUMERIC_EQ;
17
    }
18
19
    /**
20
     * Return the name of the type, unique.
21
     *
22
     * @return string
23
     */
24
    public function getName()
25
    {
26
        return 'percentage';
27
    }
28
29
    /**
30
     * Return an array of available sorting methods.
31
     *
32
     * @return array
33
     */
34
    public function getAvailableFilterMethods()
35
    {
36
        return [
37
            FilterCondition::METHOD_NUMERIC_GT,
38
            FilterCondition::METHOD_NUMERIC_GTE,
39
            FilterCondition::METHOD_NUMERIC_EQ,
40
            FilterCondition::METHOD_NUMERIC_LTE,
41
            FilterCondition::METHOD_NUMERIC_LT,
42
            FilterCondition::METHOD_NUMERIC_NEQ,
43
        ];
44
    }
45
}
46