Completed
Push — master ( dbdc32...0d10e3 )
by Nicolas
02:23
created

SpanNot::setExclude()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace Elastica\Query;
3
4
/**
5
 * SpanNot query.
6
 *
7
 * @author Alessandro Chitolina <[email protected]>
8
 *
9
 * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-not-query.html
10
 */
11 View Code Duplication
class SpanNot extends AbstractSpanQuery
0 ignored issues
show
Duplication introduced by
This class 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...
12
{
13
    /**
14
     * Constructs a SpanWithin query object.
15
     *
16
     * @param AbstractSpanQuery $include OPTIONAL
17
     * @param AbstractSpanQuery $exclude OPTIONAL
18
     */
19
    public function __construct(AbstractSpanQuery $include = null, AbstractSpanQuery $exclude = null)
20
    {
21
        if (null !== $include) {
22
            $this->setInclude($include);
23
        }
24
25
        if (null !== $exclude) {
26
            $this->setExclude($exclude);
27
        }
28
    }
29
30
    /**
31
     * @param AbstractSpanQuery $include
32
     *
33
     * @return $this
34
     */
35
    public function setInclude(AbstractSpanQuery $include)
36
    {
37
        return $this->setParam('include', $include);
38
    }
39
40
    /**
41
     * @param AbstractSpanQuery $exclude
42
     *
43
     * @return $this
44
     */
45
    public function setExclude(AbstractSpanQuery $exclude)
46
    {
47
        return $this->setParam('exclude', $exclude);
48
    }
49
}
50