1 | <?php |
||
10 | class Result |
||
11 | { |
||
12 | /** |
||
13 | * @var mixed Data return by executed code |
||
14 | */ |
||
15 | private $returnValue; |
||
16 | |||
17 | /** |
||
18 | * @var string Output made by executed code |
||
19 | */ |
||
20 | private $output; |
||
21 | |||
22 | /** |
||
23 | * @var \Exception Exception thrown by executed code |
||
24 | */ |
||
25 | private $exception; |
||
26 | |||
27 | /** |
||
28 | * Construct result object |
||
29 | * |
||
30 | * @param mixed $returnValue Data return by executed code |
||
31 | * @param string $output Output made by executed code |
||
32 | * @param \Exception|null $exception Exception thrown by executed code |
||
33 | */ |
||
34 | public function __construct($returnValue, string $output, \Exception $exception = null) |
||
40 | |||
41 | /** |
||
42 | * Get data returned by executed code |
||
43 | * |
||
44 | * @return mixed |
||
45 | */ |
||
46 | public function getReturnValue() |
||
50 | |||
51 | /** |
||
52 | * Get output made by executed code |
||
53 | */ |
||
54 | public function getOutput(): string |
||
58 | |||
59 | /** |
||
60 | * Get exception thrown by executed code |
||
61 | * |
||
62 | * @return \Exception|null |
||
63 | */ |
||
64 | public function getException() |
||
68 | } |
||
69 |