| @@ 17-53 (lines=37) @@ | ||
| 14 | use APL\Response\ResponseInterface; |
|
| 15 | use Symfony\Component\EventDispatcher\Event; |
|
| 16 | ||
| 17 | class PostCommandEvent extends Event |
|
| 18 | { |
|
| 19 | /** @var CommandInterface */ |
|
| 20 | private $command; |
|
| 21 | ||
| 22 | /** @var ResponseInterface */ |
|
| 23 | private $response; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * |
|
| 27 | * @param CommandInterface $command |
|
| 28 | * @param ResponseInterface $response |
|
| 29 | */ |
|
| 30 | public function __construct(CommandInterface $command, ResponseInterface $response) |
|
| 31 | { |
|
| 32 | $this->command = $command; |
|
| 33 | $this->response = $response; |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * |
|
| 38 | * @return CommandInterface |
|
| 39 | */ |
|
| 40 | public function getCommand() |
|
| 41 | { |
|
| 42 | return $this->command; |
|
| 43 | } |
|
| 44 | ||
| 45 | /** |
|
| 46 | * |
|
| 47 | * @return ResponseInterface |
|
| 48 | */ |
|
| 49 | public function getResponse() |
|
| 50 | { |
|
| 51 | return $this->response; |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 21-66 (lines=46) @@ | ||
| 18 | * |
|
| 19 | * @author David Badura <[email protected]> |
|
| 20 | */ |
|
| 21 | class TerminateEvent extends Event |
|
| 22 | { |
|
| 23 | /** @var CommandInterface */ |
|
| 24 | private $command; |
|
| 25 | ||
| 26 | /** @var ResponseInterface */ |
|
| 27 | private $response; |
|
| 28 | ||
| 29 | /** |
|
| 30 | * |
|
| 31 | * @param CommandInterface $command |
|
| 32 | * @param ResponseInterface $response |
|
| 33 | */ |
|
| 34 | public function __construct(CommandInterface $command, ResponseInterface $response) |
|
| 35 | { |
|
| 36 | $this->command = $command; |
|
| 37 | $this->response = $response; |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * |
|
| 42 | * @param CommandInterface |
|
| 43 | */ |
|
| 44 | public function getCommand() |
|
| 45 | { |
|
| 46 | return $this->command; |
|
| 47 | } |
|
| 48 | ||
| 49 | /** |
|
| 50 | * |
|
| 51 | * @param ResponseInterface $response |
|
| 52 | */ |
|
| 53 | public function setResponse(ResponseInterface $response) |
|
| 54 | { |
|
| 55 | $this->response = $response; |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * |
|
| 60 | * @return ResponseInterface |
|
| 61 | */ |
|
| 62 | public function getResponse() |
|
| 63 | { |
|
| 64 | return $this->response; |
|
| 65 | } |
|
| 66 | } |
|
| 67 | ||