StringDataType::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Netdudes\DataSourceryBundle\DataType;
4
5
use Netdudes\DataSourceryBundle\Query\FilterCondition;
6
7
class StringDataType extends AbstractDataType
8
{
9
    /**
10
     * Return an array of available filter methods
11
     *
12
     * @return array
13
     */
14 View Code Duplication
    public function getAvailableFilterMethods()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
    {
16
        return [
17
            FilterCondition::METHOD_STRING_EQ,
18
            FilterCondition::METHOD_STRING_NEQ,
19
            FilterCondition::METHOD_STRING_LIKE,
20
            FilterCondition::METHOD_IN,
21
            FilterCondition::METHOD_NIN,
22
        ];
23
    }
24
25
    /**
26
     * Return the identifier of the default sort method
27
     *
28
     * @return int
29
     */
30
    public function getDefaultFilterMethod()
31
    {
32
        return FilterCondition::METHOD_STRING_EQ;
33
    }
34
35
    /**
36
     * Return the name of the type, unique.
37
     *
38
     * @return string
39
     */
40
    public function getName()
41
    {
42
        return 'string';
43
    }
44
}
45