1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
5
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
6
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
7
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
8
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
9
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
10
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
11
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
12
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
13
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
14
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
15
|
|
|
* |
16
|
|
|
* This software consists of voluntary contributions made by many individuals |
17
|
|
|
* and is licensed under the MIT license. For more information, see |
18
|
|
|
* <http://www.doctrine-project.org>. |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace Baleen\Cli\CommandBus; |
22
|
|
|
|
23
|
|
|
use Baleen\Cli\Config\ConfigInterface; |
24
|
|
|
use Symfony\Component\Console\Command\Command; |
25
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
26
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Class AbstractMessage. |
30
|
|
|
* |
31
|
|
|
* @author Gabriel Somoza <[email protected]> |
32
|
|
|
*/ |
33
|
|
|
abstract class AbstractMessage implements MessageInterface |
34
|
|
|
{ |
35
|
|
|
/** @var ConfigInterface */ |
36
|
|
|
protected $config; |
37
|
|
|
|
38
|
|
|
/** @var InputInterface */ |
39
|
|
|
protected $input; |
40
|
|
|
|
41
|
|
|
/** @var OutputInterface */ |
42
|
|
|
protected $output; |
43
|
|
|
|
44
|
|
|
/** @var Command */ |
45
|
|
|
protected $cliCommand; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @inheritdoc |
49
|
|
|
*/ |
50
|
|
|
public function getConfig() |
51
|
|
|
{ |
52
|
|
|
return $this->config; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @inheritdoc |
57
|
|
|
*/ |
58
|
|
|
public function setConfig(ConfigInterface $config) |
59
|
|
|
{ |
60
|
|
|
$this->config = $config; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @inheritdoc |
65
|
|
|
*/ |
66
|
|
|
public function getInput() |
67
|
|
|
{ |
68
|
|
|
return $this->input; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @inheritdoc |
73
|
|
|
*/ |
74
|
|
|
public function setInput(InputInterface $input) |
75
|
|
|
{ |
76
|
|
|
$this->input = $input; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @inheritdoc |
81
|
|
|
*/ |
82
|
|
|
public function getOutput() |
83
|
|
|
{ |
84
|
|
|
return $this->output; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @inheritdoc |
89
|
|
|
*/ |
90
|
|
|
public function setOutput(OutputInterface $output) |
91
|
|
|
{ |
92
|
|
|
$this->output = $output; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @return Command |
97
|
|
|
*/ |
98
|
|
|
public function getCliCommand() |
99
|
|
|
{ |
100
|
|
|
return $this->cliCommand; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @param Command $cliCommand |
105
|
|
|
*/ |
106
|
|
|
public function setCliCommand(Command $cliCommand) |
107
|
|
|
{ |
108
|
|
|
$this->cliCommand = $cliCommand; |
109
|
|
|
} |
110
|
|
|
} |
111
|
|
|
|