1 | <?php |
||
16 | class MessageApplication implements LoggerAwareInterface |
||
17 | { |
||
18 | use LoggerAwareTrait; |
||
19 | |||
20 | /** |
||
21 | * @var MessageSender |
||
22 | */ |
||
23 | protected $messageSender; |
||
24 | |||
25 | /** |
||
26 | * @var MessageParser |
||
27 | */ |
||
28 | protected $messageParser; |
||
29 | |||
30 | /** |
||
31 | * @var MessageFactory |
||
32 | */ |
||
33 | private $messageFactory; |
||
34 | |||
35 | /** |
||
36 | * @var CommandBus |
||
37 | */ |
||
38 | protected $commandBus; |
||
39 | |||
40 | /** |
||
41 | * Constructor |
||
42 | * |
||
43 | * @param MessageSender $messageSender |
||
44 | * @param MessageParser $messageParser |
||
45 | * @param MessageFactory $messageFactory |
||
46 | * @param CommandBus $commandBus |
||
47 | */ |
||
48 | 12 | public function __construct( |
|
60 | |||
61 | /** |
||
62 | * Handle a message |
||
63 | * |
||
64 | * @param mixed $message |
||
65 | * @return void |
||
66 | */ |
||
67 | 12 | public function handle($message) |
|
73 | |||
74 | /** |
||
75 | * Parse the message |
||
76 | * |
||
77 | * @param mixed $message |
||
78 | * @return NamedCommand |
||
79 | */ |
||
80 | 12 | private function parseMessage($message) |
|
101 | |||
102 | /** |
||
103 | * Handles the command |
||
104 | * |
||
105 | * @param NamedCommand $command |
||
106 | */ |
||
107 | 12 | private function handleCommand(NamedCommand $command = null) |
|
116 | |||
117 | /** |
||
118 | * @param MessageParserException $exception |
||
119 | * |
||
120 | * @return UndefinedApplicationUser |
||
121 | */ |
||
122 | 6 | private function getMessageUser(MessageParserException $exception) |
|
126 | } |
||
127 |