Completed
Push — V2x ( ef7ee8 )
by Daniel
02:49
created

CreateUpdateDocumentResponse   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 64
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 1
dl 64
loc 64
ccs 15
cts 15
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A created() 6 6 1
A getId() 6 6 1
A getVersion() 6 6 1
A getIndex() 6 6 1
A getType() 6 6 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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\Response\V2x;
19
20
use Elastification\Client\Response\Response;
21
22
/**
23
 * @package Elastification\Client\Response\V1x
24
 * @author  Daniel Wendlandt
25
 */
26 View Code Duplication
class CreateUpdateDocumentResponse extends Response
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...
27
{
28
29
    const PROP_CREATED = 'created';
30
    const PROP_ID = '_id';
31
    const PROP_VERSION = '_version';
32
    const PROP_INDEX = '_index';
33
    const PROP_TYPE = '_type';
34
35
    /**
36
     * @return boolean
37
     * @author Mario Mueller
38
     */
39 2
    public function created()
40
    {
41 2
        $this->processData();
42
43 2
        return $this->get(self::PROP_CREATED);
44
    }
45
46
    /**
47
     * @return string
48
     * @author Mario Mueller
49
     */
50 2
    public function getId()
51
    {
52 2
        $this->processData();
53
54 2
        return $this->get(self::PROP_ID);
55
    }
56
57
    /**
58
     * @return integer
59
     * @author Mario Mueller
60
     */
61 2
    public function getVersion()
62
    {
63 2
        $this->processData();
64
65 2
        return $this->get(self::PROP_VERSION);
66
    }
67
68
    /**
69
     * @return string
70
     * @author Mario Mueller
71
     */
72 2
    public function getIndex()
73
    {
74 2
        $this->processData();
75
76 2
        return $this->get(self::PROP_INDEX);
77
    }
78
79
    /**
80
     * @return string
81
     * @author Mario Mueller
82
     */
83 2
    public function getType()
84
    {
85 2
        $this->processData();
86
87 2
        return $this->get(self::PROP_TYPE);
88
    }
89
}
90