Completed
Push — cat-json ( 4bf80b...d08645 )
by Daniel
06:10
created

AbstractShardsCatRequest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getMethod() 0 4 1
A getAction() 0 4 1
A getIndex() 0 4 1
A getType() 0 4 1
A getBody() 0 4 1
A setBody() 0 4 1
1
<?php
2
/*
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the MIT license.
17
 */
18
namespace Elastification\Client\Request\Shared\Cat;
19
20
use Elastification\Client\Request\RequestMethods;
21
use Elastification\Client\Request\Shared\AbstractBaseRequest;
22
use Elastification\Client\Serializer\SerializerInterface;
23
24
abstract class AbstractShardsCatRequest extends AbstractBaseRequest
25
{
26
    const REQUEST_ACTION = '_cat';
27
    const CAT_TYPE = 'shards';
28
29
    public function __construct($index, $type, SerializerInterface $serializer, array $serializerParams = array())
30
    {
31
        parent::__construct($index, $type, $serializer, $serializerParams);
32
33
        $this->setParameter('format', 'json');
34
    }
35
36
    /**
37
     * @inheritdoc
38
     */
39
    public function getMethod()
40
    {
41
        return RequestMethods::GET;
42
    }
43
44
    /**
45
     * @inheritdoc
46
     */
47
    public function getAction()
48
    {
49
        return self::CAT_TYPE;
50
    }
51
52
    /**
53
     * @inheritdoc
54
     */
55
    public function getIndex()
56
    {
57
        return self::REQUEST_ACTION;
58
    }
59
60
    /**
61
     * @inheritdoc
62
     */
63
    public function getType()
64
    {
65
        return null;
66
    }
67
68
    /**
69
     * @inheritdoc
70
     */
71
    public function getBody()
72
    {
73
        return null;
74
    }
75
76
    /**
77
     * @inheritdoc
78
     */
79
    public function setBody($body)
80
    {
81
        //do nothing
82
    }
83
}
84