Completed
Pull Request — master (#102)
by
unknown
03:14
created

SpanContainingQuery   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 7
c 2
b 0
f 2
lcom 1
cbo 0
dl 0
loc 75
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getBig() 0 4 1
A setBig() 0 4 1
A getLittle() 0 4 1
A setLittle() 0 4 1
A getType() 0 4 1
A toArray() 0 9 1
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ONGR\ElasticsearchDSL\Query\Span;
13
14
/**
15
 * Elasticsearch span containing query.
16
 *
17
 * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-span-containing-query.html
18
 */
19
class SpanContainingQuery implements SpanQueryInterface
20
{
21
    /**
22
     * @param SpanQueryInterface
23
     */
24
    private $big;
25
26
    /**
27
     * @param SpanQueryInterface
28
     */
29
    private $little;
30
31
    /**
32
     * @param SpanQueryInterface $big
33
     * @param SpanQueryInterface $little
34
     */
35
    public function __construct(SpanQueryInterface $big, SpanQueryInterface $little)
36
    {
37
        $this->setBig($big);
38
        $this->setLittle($little);
39
    }
40
41
    /**
42
     * @return mixed
43
     */
44
    public function getBig()
45
    {
46
        return $this->big;
47
    }
48
49
    /**
50
     * @param mixed $big
51
     */
52
    public function setBig($big)
53
    {
54
        $this->big = $big;
55
    }
56
57
    /**
58
     * @return mixed
59
     */
60
    public function getLittle()
61
    {
62
        return $this->little;
63
    }
64
65
    /**
66
     * @param mixed $little
67
     */
68
    public function setLittle($little)
69
    {
70
        $this->little = $little;
71
    }
72
73
    /**
74
     * {@inheritdoc}
75
     */
76
    public function getType()
77
    {
78
        return 'span_containing';
79
    }
80
81
    /**
82
     * {@inheritdoc}
83
     */
84
    public function toArray()
85
    {
86
        $out = [
87
            'little' => $this->getLittle()->toArray(),
88
            'big' => $this->getBig()->toArray(),
89
        ];
90
91
        return [$this->getType() => $out];
92
    }
93
}
94