4 * This file is part of the Behat Testwork.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Testwork\Call;
16 * Represents result of the call.
18 * @author Konstantin Kudryashov <ever.zet@gmail.com>
20 final class CallResult
40 * Initializes call result.
43 * @param mixed $return
44 * @param null|Exception $exception
45 * @param null|string $stdOut
47 public function __construct(Call $call, $return, Exception $exception = null, $stdOut = null)
50 $this->return = $return;
51 $this->exception = $exception;
52 $this->stdOut = $stdOut;
60 public function getCall()
66 * Returns call return value.
70 public function getReturn()
76 * Check if call thrown exception.
80 public function hasException()
82 return null !== $this->exception;
86 * Returns exception thrown by call (if any).
88 * @return null|Exception
90 public function getException()
92 return $this->exception;
96 * Checks if call produced stdOut.
100 public function hasStdOut()
102 return null !== $this->stdOut;
106 * Returns stdOut produced by call (if any).
108 * @return null|string
110 public function getStdOut()
112 return $this->stdOut;