diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-09-21 20:38:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-21 20:38:18 +0200 |
commit | 38568c362b55e5b77838ab40d81c23fd724633d1 (patch) | |
tree | 1fe12b7ab3f1dfd13669a904e3b2fd9303ff6b37 /lib | |
parent | e336283a4860b1e4e498968980905105711a6776 (diff) | |
parent | 7eba0a2720ec7cece503c4d6e3859b208fd312cb (diff) | |
download | nextcloud-server-38568c362b55e5b77838ab40d81c23fd724633d1.tar.gz nextcloud-server-38568c362b55e5b77838ab40d81c23fd724633d1.zip |
Merge pull request #6605 from nextcloud/oc_ocs_response_is_dep
OC_OCS_Response is deprecated
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/legacy/api.php | 14 | ||||
-rw-r--r-- | lib/private/legacy/ocs/result.php | 28 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/OCSResponse.php | 2 |
3 files changed, 8 insertions, 36 deletions
diff --git a/lib/private/legacy/api.php b/lib/private/legacy/api.php index f65275bf1da..7fe84b73c43 100644 --- a/lib/private/legacy/api.php +++ b/lib/private/legacy/api.php @@ -129,7 +129,7 @@ class OC_API { if(!self::isAuthorised($action)) { $responses[] = array( 'app' => $action['app'], - 'response' => new OC_OCS_Result(null, API::RESPOND_UNAUTHORISED, 'Unauthorised'), + 'response' => new \OC\OCS\Result(null, API::RESPOND_UNAUTHORISED, 'Unauthorised'), 'shipped' => $appManager->isShipped($action['app']), ); continue; @@ -137,7 +137,7 @@ class OC_API { if(!is_callable($action['action'])) { $responses[] = array( 'app' => $action['app'], - 'response' => new OC_OCS_Result(null, API::RESPOND_NOT_FOUND, 'Api method not found'), + 'response' => new \OC\OCS\Result(null, API::RESPOND_NOT_FOUND, 'Api method not found'), 'shipped' => $appManager->isShipped($action['app']), ); continue; @@ -161,7 +161,7 @@ class OC_API { /** * merge the returned result objects into one response * @param array $responses - * @return OC_OCS_Result + * @return \OC\OCS\Result */ public static function mergeResponses($responses) { // Sort into shipped and third-party @@ -205,7 +205,7 @@ class OC_API { $code = $picked['response']->getStatusCode(); $meta = $picked['response']->getMeta(); $headers = $picked['response']->getHeaders(); - $response = new OC_OCS_Result($data, $code, $meta['message'], $headers); + $response = new \OC\OCS\Result($data, $code, $meta['message'], $headers); return $response; } elseif(!empty($shipped['succeeded'])) { $responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']); @@ -219,7 +219,7 @@ class OC_API { $code = $picked['response']->getStatusCode(); $meta = $picked['response']->getMeta(); $headers = $picked['response']->getHeaders(); - $response = new OC_OCS_Result($data, $code, $meta['message'], $headers); + $response = new \OC\OCS\Result($data, $code, $meta['message'], $headers); return $response; } else { $responses = $thirdparty['succeeded']; @@ -251,7 +251,7 @@ class OC_API { } } - return new OC_OCS_Result($data, $statusCode, $statusMessage, $header); + return new \OC\OCS\Result($data, $statusCode, $statusMessage, $header); } /** @@ -351,7 +351,7 @@ class OC_API { /** * respond to a call - * @param OC_OCS_Result $result + * @param \OC\OCS\Result $result * @param string $format the format xml|json */ public static function respond($result, $format='xml') { diff --git a/lib/private/legacy/ocs/result.php b/lib/private/legacy/ocs/result.php deleted file mode 100644 index fd90e56c602..00000000000 --- a/lib/private/legacy/ocs/result.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Roeland Jago Douma <roeland@famdouma.nl> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -/** - * @deprecated Since 9.1.0 use \OC\OCS\Result - */ -class OC_OCS_Result extends \OC\OCS\Result { -} diff --git a/lib/public/AppFramework/Http/OCSResponse.php b/lib/public/AppFramework/Http/OCSResponse.php index 8614e76805f..ee1207f1217 100644 --- a/lib/public/AppFramework/Http/OCSResponse.php +++ b/lib/public/AppFramework/Http/OCSResponse.php @@ -83,7 +83,7 @@ class OCSResponse extends Response { * @suppress PhanDeprecatedClass */ public function render() { - $r = new \OC_OCS_Result($this->data, $this->statuscode, $this->message); + $r = new \OC\OCS\Result($this->data, $this->statuscode, $this->message); $r->setTotalItems($this->itemscount); $r->setItemsPerPage($this->itemsperpage); |