| 1 | <?php |
||
| 10 | class Report |
||
| 11 | { |
||
| 12 | /** @var ActionInterface executed task */ |
||
| 13 | private $action; |
||
| 14 | |||
| 15 | /** @var mixed Execution result (task return value) */ |
||
| 16 | private $result; |
||
| 17 | |||
| 18 | /** @var string 'success'|'error'*/ |
||
| 19 | private $type; |
||
| 20 | |||
| 21 | const TYPE_SUCCESS = 'success'; |
||
| 22 | const TYPE_ERROR = 'error'; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Report constructor. |
||
| 26 | * @param ActionInterface $action |
||
| 27 | * @param mixed $result - action execution result or thrown exception in case of error |
||
| 28 | * @param string $type |
||
| 29 | */ |
||
| 30 | 5 | public function __construct(ActionInterface $action, $result, $type = self::TYPE_SUCCESS) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Action execution result or thrown exception in case of error |
||
| 39 | * @return mixed |
||
| 40 | */ |
||
| 41 | 2 | public function getResult() |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @return ActionInterface |
||
| 48 | */ |
||
| 49 | 1 | public function getAction() |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @return string |
||
| 56 | */ |
||
| 57 | 1 | public function getType() |
|
| 61 | } |