Completed
Push — master ( 48c3ae...6eeb89 )
by
unknown
05:00 queued 02:22
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
namespace Netdudes\DataSourceryBundle\DataType;
3
4
use Netdudes\DataSourceryBundle\Query\FilterCondition;
5
6
class PercentDataType extends AbstractDataType
7
{
8
    /**
9
     * Return the identifier of the default sort method.
10
     *
11
     * @return int
12
     */
13
    public function getDefaultFilterMethod()
14
    {
15
        return FilterCondition::METHOD_NUMERIC_EQ;
16
    }
17
18
    /**
19
     * Return the name of the type, unique.
20
     *
21
     * @return string
22
     */
23
    public function getName()
24
    {
25
        return 'percentage';
26
    }
27
28
    /**
29
     * Return an array of available sorting methods.
30
     *
31
     * @return array
32
     */
33
    public function getAvailableFilterMethods()
34
    {
35
        return [
36
            FilterCondition::METHOD_NUMERIC_GT,
37
            FilterCondition::METHOD_NUMERIC_GTE,
38
            FilterCondition::METHOD_NUMERIC_EQ,
39
            FilterCondition::METHOD_NUMERIC_LTE,
40
            FilterCondition::METHOD_NUMERIC_LT,
41
            FilterCondition::METHOD_NUMERIC_NEQ,
42
        ];
43
    }
44
}
45