Completed
Pull Request — master (#1)
by Woody
27:07 queued 01:07
created

Payload   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 98
Duplicated Lines 0 %

Coupling/Cohesion

Components 4
Dependencies 0

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 8
c 3
b 0
f 1
lcom 4
cbo 0
dl 0
loc 98
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A withStatus() 0 7 1
A getStatus() 0 4 1
A withInput() 0 7 1
A getInput() 0 4 1
A withOutput() 0 7 1
A getOutput() 0 4 1
A withMessages() 0 7 1
A getMessages() 0 4 1
1
<?php
2
namespace Equip;
3
4
use Equip\Adr\PayloadInterface;
5
6
class Payload implements PayloadInterface
7
{
8
    /**
9
     * @var integer
10
     */
11
    private $status;
12
13
    /**
14
     * @var array
15
     */
16
    private $input;
17
18
    /**
19
     * @var array
20
     */
21
    private $output;
22
23
    /**
24
     * @var array
25
     */
26
    private $messages;
27
28
    /**
29
     * @inheritDoc
30
     */
31 7
    public function withStatus($code)
32
    {
33 7
        $copy = clone $this;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 9 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
34 7
        $copy->status = $code;
35
36 7
        return $copy;
37
    }
38
39
    /**
40
     * @inheritDoc
41
     */
42 7
    public function getStatus()
43
    {
44 7
        return $this->status;
45
    }
46
47
    /**
48
     * @inheritDoc
49
     */
50 1
    public function withInput(array $input)
51
    {
52 1
        $copy = clone $this;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
53 1
        $copy->input = $input;
54
55 1
        return $copy;
56
    }
57
58
    /**
59
     * @inheritDoc
60
     */
61 1
    public function getInput()
62
    {
63 1
        return $this->input;
64
    }
65
66
    /**
67
     * @inheritDoc
68
     */
69 5
    public function withOutput(array $output)
70
    {
71 5
        $copy = clone $this;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 9 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
72 5
        $copy->output = $output;
73
74 5
        return $copy;
75
    }
76
77
    /**
78
     * @inheritDoc
79
     */
80 6
    public function getOutput()
81
    {
82 6
        return $this->output;
83
    }
84
85
    /**
86
     * @inheritDoc
87
     */
88 2
    public function withMessages(array $messages)
89
    {
90 2
        $copy = clone $this;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 11 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
91 2
        $copy->messages = $messages;
92
93 2
        return $copy;
94
    }
95
96
    /**
97
     * @inheritDoc
98
     */
99 4
    public function getMessages()
100
    {
101 4
        return $this->messages;
102
    }
103
}
104