Completed
Pull Request — master (#19)
by Akihito
04:19
created

Result::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Ackintosh\Snidel\Result;
3
4
use Bernard\Message\AbstractMessage;
5
6
class Result extends AbstractMessage
7
{
8
    /** @var mixed */
9
    private $return;
10
11
    /** @var string */
12
    private $output;
13
14
    /** @var \Ackintosh\Snidel\Fork\Process */
15
    private $process;
16
17
    /** @var \Ackintosh\Snidel\Task\Task */
18
    private $task;
19
20
    /** @var bool */
21
    private $failure = false;
22
23
    /** @var array */
24
    private $error;
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function getName()
30
    {
31
        return 'Result';
32
    }
33
34
    /**
35
     * set return
36
     *
37
     * @param   mixed     $return
38
     * @return  void
39
     */
40
    public function setReturn($return)
41
    {
42
        $this->return = $return;
43
    }
44
45
    /**
46
     * return return value
47
     *
48
     * @return  mixed
49
     */
50
    public function getReturn()
51
    {
52
        return $this->return;
53
    }
54
55
    /**
56
     * set output
57
     *
58
     * @param   string  $output
59
     * @return  void
60
     */
61
    public function setOutput($output)
62
    {
63
        $this->output = $output;
64
    }
65
66
    /**
67
     * return output
68
     *
69
     * @return  string
70
     */
71
    public function getOutput()
72
    {
73
        return $this->output;
74
    }
75
76
    /**
77
     * @param   \Ackintosh\Snidel\Fork\Process
78
     * @return  void
79
     */
80
    public function setProcess($fork)
81
    {
82
        $this->process = $fork;
83
    }
84
85
    /**
86
     * @return  \Ackintosh\Snidel\Fork\Process
87
     */
88
    public function getProcess()
89
    {
90
        return $this->process;
91
    }
92
93
    /**
94
     * @param   \Ackintosh\Snidel\Task\Task
95
     * @return  void
96
     */
97
    public function setTask($task)
98
    {
99
        $this->task = $task;
100
    }
101
102
    /**
103
     * @return  \Ackintosh\Snidel\Task\Task
104
     */
105
    public function getTask()
106
    {
107
        return $this->task;
108
    }
109
110
    /**
111
     * @param   array | null
112
     * @return  void
113
     */
114
    public function setError($error)
115
    {
116
        $this->failure  = true;
117
        $this->error    = $error;
118
    }
119
120
    /**
121
     * @return  array | null
122
     */
123
    public function getError()
124
    {
125
        return $this->error;
126
    }
127
128
    /**
129
     * @return  bool
130
     */
131
    public function isFailure()
132
    {
133
        return $this->failure;
134
    }
135
136
    public function __clone()
137
    {
138
        // to avoid point to same object.
139
        $this->task = clone $this->task;
140
    }
141
}
142