src/Http/ErrorResponseBuilder.php 1 location
|
@@ 114-121 (lines=8) @@
|
111 |
|
* @return self |
112 |
|
* @throws \InvalidArgumentException |
113 |
|
*/ |
114 |
|
public function setStatus(int $statusCode):ResponseBuilder |
115 |
|
{ |
116 |
|
if ($statusCode < 400 || $statusCode >= 600) { |
117 |
|
throw new InvalidArgumentException("{$statusCode} is not a valid error HTTP status code."); |
118 |
|
} |
119 |
|
|
120 |
|
return parent::setStatus($statusCode); |
121 |
|
} |
122 |
|
|
123 |
|
/** |
124 |
|
* Serialize the data and return as an array. |
src/Http/SuccessResponseBuilder.php 1 location
|
@@ 133-140 (lines=8) @@
|
130 |
|
* @return self |
131 |
|
* @throws \InvalidArgumentException |
132 |
|
*/ |
133 |
|
public function setStatus(int $statusCode):ResponseBuilder |
134 |
|
{ |
135 |
|
if ($statusCode < 100 || $statusCode >= 400) { |
136 |
|
throw new InvalidArgumentException("{$statusCode} is not a valid success HTTP status code."); |
137 |
|
} |
138 |
|
|
139 |
|
return parent::setStatus($statusCode); |
140 |
|
} |
141 |
|
|
142 |
|
/** |
143 |
|
* Set the transformation data. This will set a new resource instance on the response |