mirror of
https://github.com/nextcloud/documentation.git
synced 2026-01-03 02:09:45 +07:00
Pass the HTTP status code directly in the constructor
My IDE is telling me this way of doing things doesn't not work ``` return new JSONResponse()->setStatus(Http::STATUS_NOT_FOUND); ```
This commit is contained in:
committed by
Lukas Reschke
parent
a20eccfece
commit
4a8b44ff1f
@@ -504,7 +504,7 @@ Each response subclass has access to the **setStatus** method which lets you set
|
||||
// try to get author with $id
|
||||
|
||||
} catch (NotFoundException $ex) {
|
||||
return new JSONResponse()->setStatus(Http::STATUS_NOT_FOUND);
|
||||
return new JSONResponse(array(), Http::STATUS_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user