diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2016-08-10 22:36:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-10 22:36:25 +0200 |
commit | ba922c9f73c8b61998686d2273fbaccc7f88ed97 (patch) | |
tree | bb9b6985d64358b68ea5168e7a12b6dd08d58a9c /lib/public | |
parent | 67d016833d637982a197bb848836c7afcea88358 (diff) | |
parent | 9544c97ffe888a16cdf58013b5a97056771eb856 (diff) | |
download | nextcloud-server-ba922c9f73c8b61998686d2273fbaccc7f88ed97.tar.gz nextcloud-server-ba922c9f73c8b61998686d2273fbaccc7f88ed97.zip |
Merge pull request #807 from nextcloud/ocs_dataresponse
OCSController requires DataResponse
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/AppFramework/OCSController.php | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/public/AppFramework/OCSController.php b/lib/public/AppFramework/OCSController.php index bd50f0a4017..6036fc6a5a8 100644 --- a/lib/public/AppFramework/OCSController.php +++ b/lib/public/AppFramework/OCSController.php @@ -88,26 +88,19 @@ abstract class OCSController extends ApiController { /** * Unwrap data and build ocs response * @param string $format json or xml - * @param array|DataResponse $data the data which should be transformed + * @param DataResponse $data the data which should be transformed * @since 8.1.0 + * @return OCSResponse */ - private function buildOCSResponse($format, $data) { - if ($data instanceof DataResponse) { - $data = $data->getData(); - } - + private function buildOCSResponse($format, DataResponse $data) { $params = [ 'statuscode' => 100, 'message' => 'OK', - 'data' => [], + 'data' => $data->getData(), 'itemscount' => '', 'itemsperpage' => '' ]; - foreach ($data as $key => $value) { - $params[$key] = $value; - } - return new OCSResponse( $format, $params['statuscode'], $params['message'], $params['data'], |