1 | <?php |
||
10 | trait CheckResponse |
||
11 | { |
||
12 | /** |
||
13 | * Get response. set for controller |
||
14 | * |
||
15 | * @return ResponseInterface |
||
16 | */ |
||
17 | abstract public function getResponse(); |
||
18 | |||
19 | |||
20 | /** |
||
21 | * Check if response is a 1xx informational |
||
22 | * |
||
23 | * @return boolean |
||
24 | */ |
||
25 | 15 | public function isInformational() |
|
30 | |||
31 | /** |
||
32 | * Check if response is 2xx succesful, or empty |
||
33 | * |
||
34 | * @return boolean |
||
35 | */ |
||
36 | 15 | public function isSuccessful() |
|
41 | |||
42 | /** |
||
43 | * Check if response is a 3xx redirect |
||
44 | * |
||
45 | * @return boolean |
||
46 | */ |
||
47 | 15 | public function isRedirection() |
|
52 | |||
53 | /** |
||
54 | * Check if response is a 4xx client error |
||
55 | * |
||
56 | * @return boolean |
||
57 | */ |
||
58 | 15 | public function isClientError() |
|
63 | |||
64 | /** |
||
65 | * Check if response is a 5xx redirect |
||
66 | * |
||
67 | * @return boolean |
||
68 | */ |
||
69 | 15 | public function isServerError() |
|
74 | |||
75 | /** |
||
76 | * Check if response is 4xx or 5xx error |
||
77 | * |
||
78 | * @return boolean |
||
79 | */ |
||
80 | 15 | public function isError() |
|
84 | } |
||
85 |