From 537d588726f0ddc1a3a0327156912a0ec4089abb Mon Sep 17 00:00:00 2001 From: Donquixote Date: Sat, 29 Oct 2016 18:00:01 +0800 Subject: refactoring code to reduce cyclomatic complexit Signed-off-by: Roeland Jago Douma --- lib/public/AppFramework/OCSController.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/public/AppFramework/OCSController.php') 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); } } -- cgit v1.2.3