Test Failed
Push — master ( 73c405...d57cd2 )
by Konstantins
03:14
created

Payload::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php declare(strict_types = 1);
2
3
namespace Venta\Adr;
4
5
use Venta\Contracts\Adr\Payload as PayloadContract;
6
7
/**
8
 * Class Payload
9
 *
10
 * @package Venta\Adr
11
 */
12
class Payload implements PayloadContract
13
{
14
15
    /**
16
     * @var array
17
     */
18
    private $input = [];
19
20
    /**
21
     * @var
22
     */
23
    private $output;
24
25
    /**
26
     * @var string
27
     */
28
    private $status = '';
29
30
    /**
31
     * Payload constructor.
32
     *
33
     * @param string $status
34
     */
35 4
    public function __construct(string $status)
36
    {
37 4
        $this->status = $status;
38 4
    }
39
40
    /**
41
     * @inheritDoc
42
     */
43 2
    public function input(): array
44
    {
45 2
        return $this->input;
46
    }
47
48
    /**
49
     * @inheritDoc
50
     */
51 1
    public function output()
52
    {
53 1
        return $this->output;
54
    }
55
56
    /**
57
     * @inheritDoc
58
     */
59 1
    public function status(): string
60
    {
61 1
        return $this->status;
62
    }
63
64
    /**
65
     * Input setter.
66
     *
67
     * @param array $arguments
68
     * @return PayloadContract
69
     */
70 1
    public function withInput(array $arguments): PayloadContract
71
    {
72 1
        $payload = clone $this;
73 1
        $payload->input = $arguments;
74
75 1
        return $payload;
76
    }
77
78
    /**
79
     * Output setter.
80
     *
81
     * @param $output
82
     * @return PayloadContract
83
     */
84 1
    public function withOutput($output): PayloadContract
85
    {
86 1
        $payload = clone $this;
87 1
        $payload->output = $output;
88
89 1
        return $payload;
90
    }
91
92
93
}