Test Failed
Push — master ( d89333...e2d202 )
by Alexey
03:26
created

Payload::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
ccs 0
cts 4
cp 0
cc 1
eloc 2
nc 1
nop 1
crap 2
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
    public function __construct(string $status)
36
    {
37
        $this->status = $status;
38
    }
39
40
    /**
41
     * @inheritDoc
42
     */
43
    public function input(): array
44
    {
45
        return $this->input;
46
    }
47
48
    /**
49
     * @inheritDoc
50
     */
51
    public function output()
52
    {
53
        return $this->output;
54
    }
55
56
    /**
57
     * @inheritDoc
58
     */
59
    public function status(): string
60
    {
61
        return $this->status;
62
    }
63
64
    /**
65
     * Input setter.
66
     *
67
     * @param array $arguments
68
     * @return PayloadContract
69
     */
70
    public function withInput(array $arguments): PayloadContract
71
    {
72
        $payload = clone $this;
73
        $payload->input = $arguments;
74
75
        return $payload;
76
    }
77
78
    /**
79
     * Output setter.
80
     *
81
     * @param $output
82
     * @return PayloadContract
83
     */
84
    public function withOutput($output): PayloadContract
85
    {
86
        $payload = clone $this;
87
        $payload->output = $output;
88
89
        return $payload;
90
    }
91
92
93
}