Passed
Pull Request — master (#18)
by Žilvinas
02:40
created

SealResult   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 72
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 0
dl 72
loc 72
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getFields() 8 8 1
A getStatus() 4 4 1
A setStatus() 4 4 1
A getFile() 4 4 1
A setFile() 4 4 1
A getSignatureId() 4 4 1
A setSignatureId() 4 4 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
namespace Isign\Document;
3
4
use Isign\ResultInterface;
5
6 View Code Duplication
class SealResult implements ResultInterface
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...
7
{
8
    /** @var string response status */
9
    private $status;
10
11
    /** @var array signed file containing: name, content, digest */
12
    private $file;
13
14
    /** @var string signature id */
15
    private $signatureId;
16
17
    /**
18
     * Fields expected in response
19
     * @return array
20
     */
21 3
    public function getFields()
22
    {
23
        return [
24 3
            'status',
25
            'file',
26
            'signature_id'
27
        ];
28
    }
29
30
    /**
31
     * @return string
32
     */
33 1
    public function getStatus()
34
    {
35 1
        return $this->status;
36
    }
37
38
    /**
39
     * @param string $status
40
     */
41 1
    public function setStatus($status)
42
    {
43 1
        $this->status = $status;
44 1
    }
45
46
    /**
47
     * @return array
48
     */
49 1
    public function getFile()
50
    {
51 1
        return $this->file;
52
    }
53
54
    /**
55
     * @param array $file
56
     */
57 1
    public function setFile($file)
58
    {
59 1
        $this->file = $file;
60 1
    }
61
62
    /**
63
     * @return string
64
     */
65 1
    public function getSignatureId()
66
    {
67 1
        return $this->signatureId;
68
    }
69
70
    /**
71
     * @param string $signatureId
72
     */
73 1
    public function setSignatureId($signatureId)
74
    {
75 1
        $this->signatureId = $signatureId;
76 1
    }
77
}
78