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
|
@@ 114-121 (lines=8) @@
|
| 111 |
|
* @return self |
| 112 |
|
* @throws \InvalidArgumentException |
| 113 |
|
*/ |
| 114 |
|
public function setStatus(int $statusCode):ResponseBuilder |
| 115 |
|
{ |
| 116 |
|
if ($statusCode < 100 || $statusCode >= 400) { |
| 117 |
|
throw new InvalidArgumentException("{$statusCode} is not a valid success HTTP status code."); |
| 118 |
|
} |
| 119 |
|
|
| 120 |
|
return parent::setStatus($statusCode); |
| 121 |
|
} |
| 122 |
|
|
| 123 |
|
/** |
| 124 |
|
* Set the transformation data. This will set a new resource instance on the response |