Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Testwork / Call / CallResult.php
1 <?php
2
3 /*
4  * This file is part of the Behat Testwork.
5  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 namespace Behat\Testwork\Call;
12
13 use Exception;
14
15 /**
16  * Represents result of the call.
17  *
18  * @author Konstantin Kudryashov <ever.zet@gmail.com>
19  */
20 final class CallResult
21 {
22     /**
23      * @var Call
24      */
25     private $call;
26     /**
27      * @var mixed
28      */
29     private $return;
30     /**
31      * @var null|Exception
32      */
33     private $exception;
34     /**
35      * @var null|string
36      */
37     private $stdOut;
38
39     /**
40      * Initializes call result.
41      *
42      * @param Call           $call
43      * @param mixed          $return
44      * @param null|Exception $exception
45      * @param null|string    $stdOut
46      */
47     public function __construct(Call $call, $return, Exception $exception = null, $stdOut = null)
48     {
49         $this->call = $call;
50         $this->return = $return;
51         $this->exception = $exception;
52         $this->stdOut = $stdOut;
53     }
54
55     /**
56      * Returns call.
57      *
58      * @return Call
59      */
60     public function getCall()
61     {
62         return $this->call;
63     }
64
65     /**
66      * Returns call return value.
67      *
68      * @return mixed
69      */
70     public function getReturn()
71     {
72         return $this->return;
73     }
74
75     /**
76      * Check if call thrown exception.
77      *
78      * @return Boolean
79      */
80     public function hasException()
81     {
82         return null !== $this->exception;
83     }
84
85     /**
86      * Returns exception thrown by call (if any).
87      *
88      * @return null|Exception
89      */
90     public function getException()
91     {
92         return $this->exception;
93     }
94
95     /**
96      * Checks if call produced stdOut.
97      *
98      * @return Boolean
99      */
100     public function hasStdOut()
101     {
102         return null !== $this->stdOut;
103     }
104
105     /**
106      * Returns stdOut produced by call (if any).
107      *
108      * @return null|string
109      */
110     public function getStdOut()
111     {
112         return $this->stdOut;
113     }
114 }