Completed
Push — master ( 2a3e1c...68a3b4 )
by Akihito
02:23
created

Result::setTask()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace Ackintosh\Snidel\Result;
3
4
class Result
5
{
6
    /** @var mix */
7
    private $return;
8
9
    /** @var string */
10
    private $output;
11
12
    /** @var Ackintosh\Snidel\Fork */
13
    private $fork;
14
15
    /** @var Ackintosh\Snidel\Task\Task */
16
    private $task;
17
18
    /** @var bool */
19
    private $failure = false;
20
21
    /**
22
     * set return
23
     *
24
     * @param   mix     $return
25
     * @return  void
26
     */
27
    public function setReturn($return)
28
    {
29
        $this->return = $return;
30
    }
31
32
    /**
33
     * return return value
34
     *
35
     * @return  mix
36
     */
37
    public function getReturn()
38
    {
39
        return $this->return;
40
    }
41
42
    /**
43
     * set output
44
     *
45
     * @param   string  $output
46
     * @return  void
47
     */
48
    public function setOutput($output)
49
    {
50
        $this->output = $output;
51
    }
52
53
    /**
54
     * return output
55
     *
56
     * @return  string
57
     */
58
    public function getOutput()
59
    {
60
        return $this->output;
61
    }
62
63
    /**
64
     * @return  void
65
     */
66
    public function setFailure()
67
    {
68
        $this->failure = true;
69
    }
70
71
    /**
72
     * @param   Ackintosh\Snidel\Fork
73
     * @return  void
74
     */
75
    public function setFork($fork)
76
    {
77
        $this->fork = $fork;
78
    }
79
80
    /**
81
     * @return  Ackintosh\Snidel\Fork
82
     */
83
    public function getFork()
84
    {
85
        return $this->fork;
86
    }
87
88
    /**
89
     * @param   Ackintosh\Snidel\Task\Task
90
     * @return  void
91
     */
92
    public function setTask($task)
93
    {
94
        $this->task = $task;
95
    }
96
97
    /**
98
     * @return  Ackintosh\Snidel\Task\Task
99
     */
100
    public function getTask()
101
    {
102
        return $this->task;
103
    }
104
105
    /**
106
     * @return  bool
107
     */
108
    public function isFailure()
109
    {
110
        return $this->failure;
111
    }
112
113
    public function __clone()
114
    {
115
        // to avoid point to same object.
116
        $this->task = clone $this->task;
117
    }
118
}
119