diff options
author | Donquixote <marjunebatac@gmailcom> | 2016-10-29 18:00:01 +0800 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-11-07 08:18:16 +0100 |
commit | 537d588726f0ddc1a3a0327156912a0ec4089abb (patch) | |
tree | 7926d6b73a75dfd97de2a72b6767fbed1b7dd488 /lib/public/AppFramework/OCSController.php | |
parent | 8d954c0ecebd07e4732d2ae8abfdf0135695d28c (diff) | |
download | nextcloud-server-537d588726f0ddc1a3a0327156912a0ec4089abb.tar.gz nextcloud-server-537d588726f0ddc1a3a0327156912a0ec4089abb.zip |
refactoring code to reduce cyclomatic complexit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/public/AppFramework/OCSController.php')
-rw-r--r-- | lib/public/AppFramework/OCSController.php | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/public/AppFramework/OCSController.php b/lib/public/AppFramework/OCSController.php index 5f18ba0807a..9b3b12e2b94 100644 --- a/lib/public/AppFramework/OCSController.php +++ b/lib/public/AppFramework/OCSController.php @@ -106,12 +106,9 @@ abstract class OCSController extends ApiController { */ private function buildOCSResponse($format, DataResponse $data) { if ($this->ocsVersion === 1) { - $response = new \OC\AppFramework\OCS\V1Response($data, $format); - } else { - $response = new \OC\AppFramework\OCS\V2Response($data, $format); + return new \OC\AppFramework\OCS\V1Response($data, $format); } - - return $response; + return new \OC\AppFramework\OCS\V2Response($data, $format); } } |