Completed
Push — master ( 2975e7...46c3ee )
by Rafael
07:49
created

ArrayComparisonExpression::setOp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
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\NodeComparisonOperatorType;
15
16
/**
17
 * @GraphQL\InputObjectType(
18
 *     description="Create array comparison expression to filter records by values in array.
19
20
#### Example:
21
22
Include all records with given values
23
````
24
value: ['value1', 'value2']
25
````
26
")
27
 */
28
class ArrayComparisonExpression
29
{
30
    /**
31
     * @var string|null
32
     *
33
     * @GraphQL\Field(type="NodeComparisonOperator", description="Comparison operator, default value: `CONTAINS`")
34
     */
35
    private $op = NodeComparisonOperatorType::IN;
36
37
    /**
38
     * @var array
39
     *
40
     * @GraphQL\Field(type="[string]!", description="values to search")
41
     */
42
    private $values = [];
43
44
    /**
45
     * @return null|string
46
     */
47 4
    public function getOp(): ?string
48
    {
49 4
        return $this->op;
50
    }
51
52
    /**
53
     * @param null|string $op
54
     */
55 1
    public function setOp(?string $op): void
56
    {
57 1
        $this->op = $op;
58 1
    }
59
60
    /**
61
     * @return array
62
     */
63 4
    public function getValues(): array
64
    {
65 4
        return $this->values;
66
    }
67
68
    /**
69
     * @param array $values
70
     */
71 9
    public function setValues(array $values): void
72
    {
73 9
        $this->values = $values;
74 9
    }
75
}
76