Skip to content

Commit 5ce879d

Browse files
committed
Update README.md
1 parent be04699 commit 5ce879d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ use NilPortugues\Api\Problem\ApiProblemResponse;
2222

2323
$additionalDetails = []; //you may pass additional details too.
2424

25-
ApiProblemResponse::json(404,'User with id 5 not found.', 'Not Found', 'user.not_found', $additionalDetails);
26-
ApiProblemResponse::xml(404,'User with id 5 not found.', 'Not Found', 'user.not_found', $additionalDetails);
25+
/**@var $response is a PSR7 response */
26+
$response = ApiProblemResponse::json(404,'User with id 5 not found.', 'Not Found', 'user.not_found', $additionalDetails);
27+
$response = ApiProblemResponse::xml(404,'User with id 5 not found.', 'Not Found', 'user.not_found', $additionalDetails);
2728

28-
ApiProblemResponse::fromExceptionToJson($exception);
29-
ApiProblemResponse::fromExceptionToXml($exception);
29+
$response = ApiProblemResponse::fromExceptionToJson($exception);
30+
$response = ApiProblemResponse::fromExceptionToXml($exception);
3031
```
3132

3233
**Using the constructor and handling the response yourself.**

0 commit comments

Comments
 (0)