Passed
Push — master ( 3b20b8...2ad278 )
by Rafael
03:27
created

StringComparisonExpression::getValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Model\Filter;
12
13
use Ynlo\GraphQLBundle\Annotation as GraphQL;
14
use Ynlo\GraphQLBundle\Type\StringComparisonOperatorType;
15
16
/**
17
 * @GraphQL\InputObjectType(description="Create string comparison expression to filter values by contents")
18
 */
19
class StringComparisonExpression
20
{
21
    /**
22
     * @var string|null
23
     *
24
     * @GraphQL\Field(type="StringComparisonOperator", description="Comparison operator, default value: `CONTAINS`")
25
     */
26
    private $op = StringComparisonOperatorType::CONTAINS;
27
28
    /**
29
     * @var string|null
30
     *
31
     * @GraphQL\Field(type="string", description="String value to search")
32
     */
33
    private $value;
34
35
    /**
36
     * @var string[]
37
     *
38
     * @GraphQL\Field(type="[string!]", description="Multiple strings to search (using OR), retrieve records matching ONE OF this values.")
39
     */
40
    private $values = [];
41
42
    /**
43
     * @return null|string
44
     */
45 6
    public function getOp(): ?string
46
    {
47 6
        return $this->op;
48
    }
49
50
    /**
51
     * @param null|string $op
52
     */
53 5
    public function setOp(?string $op): void
54
    {
55 5
        $this->op = $op;
56 5
    }
57
58
    /**
59
     * @return null|string
60
     */
61 6
    public function getValue(): ?string
62
    {
63 6
        return $this->value;
64
    }
65
66
    /**
67
     * @param null|string $value
68
     */
69 8
    public function setValue(?string $value): void
70
    {
71 8
        $this->value = $value;
72 8
    }
73
74
    /**
75
     * @return string[]
76
     */
77
    public function getValues(): array
78
    {
79
        return $this->values;
80
    }
81
82
    /**
83
     * @param string[] $values
84
     */
85
    public function setValues(array $values): void
86
    {
87
        $this->values = $values;
88
    }
89
}
90