1 | <?php |
||
17 | final class Response |
||
18 | { |
||
19 | /** |
||
20 | * @var boolean |
||
21 | */ |
||
22 | private $_isValid; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $_error; |
||
28 | |||
29 | /** |
||
30 | * Construct a new Response with a valid flag and error message. |
||
31 | * |
||
32 | * @param boolean $isValid represents if the response received was valid |
||
33 | * @param string $error the error message if the response is not valid |
||
34 | */ |
||
35 | public function __construct(bool $isValid = false, string $error = null) |
||
40 | |||
41 | /** |
||
42 | * Return if the request was valid. |
||
43 | * |
||
44 | * @return boolean |
||
45 | */ |
||
46 | public function valid() : bool |
||
50 | |||
51 | /** |
||
52 | * Return the error message, if one is set. |
||
53 | * |
||
54 | * @return string|null |
||
61 |