summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-03-03 21:57:34 +0100
committerGitHub <noreply@github.com>2021-03-03 21:57:34 +0100
commit5325c3002cb45b6b244d0df7c74ea5a8bbb6ee02 (patch)
treedba66ff928b43e9fc240943395e0b5a3ae74c04c /lib/private/AppFramework
parenta58b4ceaabf88aea83c24a5555e8addb28634ded (diff)
parentcc744740b790a72e2d5c6b07814dadb5b58014fb (diff)
downloadnextcloud-server-5325c3002cb45b6b244d0df7c74ea5a8bbb6ee02.tar.gz
nextcloud-server-5325c3002cb45b6b244d0df7c74ea5a8bbb6ee02.zip
Merge pull request #25917 from nextcloud/techdept/kill_deprecated/ocp_api
Remove deprecated \OCP\API
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/Middleware/OCSMiddleware.php5
-rw-r--r--lib/private/AppFramework/OCS/V1Response.php4
-rw-r--r--lib/private/AppFramework/OCS/V2Response.php8
3 files changed, 8 insertions, 9 deletions
diff --git a/lib/private/AppFramework/Middleware/OCSMiddleware.php b/lib/private/AppFramework/Middleware/OCSMiddleware.php
index 5016fc3eec8..f701f17a48e 100644
--- a/lib/private/AppFramework/Middleware/OCSMiddleware.php
+++ b/lib/private/AppFramework/Middleware/OCSMiddleware.php
@@ -29,7 +29,6 @@ use OC\AppFramework\Http;
use OC\AppFramework\OCS\BaseResponse;
use OC\AppFramework\OCS\V1Response;
use OC\AppFramework\OCS\V2Response;
-use OCP\API;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\JSONResponse;
@@ -80,7 +79,7 @@ class OCSMiddleware extends Middleware {
if ($controller instanceof OCSController && $exception instanceof OCSException) {
$code = $exception->getCode();
if ($code === 0) {
- $code = API::RESPOND_UNKNOWN_ERROR;
+ $code = \OCP\AppFramework\OCSController::RESPOND_UNKNOWN_ERROR;
}
return $this->buildNewResponse($controller, $code, $exception->getMessage());
@@ -109,7 +108,7 @@ class OCSMiddleware extends Middleware {
$message = $response->getData()['message'];
}
- return $this->buildNewResponse($controller, API::RESPOND_UNAUTHORISED, $message);
+ return $this->buildNewResponse($controller, OCSController::RESPOND_UNAUTHORISED, $message);
}
}
diff --git a/lib/private/AppFramework/OCS/V1Response.php b/lib/private/AppFramework/OCS/V1Response.php
index 97a3acce681..9ccff9ac98c 100644
--- a/lib/private/AppFramework/OCS/V1Response.php
+++ b/lib/private/AppFramework/OCS/V1Response.php
@@ -24,8 +24,8 @@
namespace OC\AppFramework\OCS;
-use OCP\API;
use OCP\AppFramework\Http;
+use OCP\AppFramework\OCSController;
class V1Response extends BaseResponse {
@@ -37,7 +37,7 @@ class V1Response extends BaseResponse {
*/
public function getStatus() {
$status = parent::getStatus();
- if ($status === Http::STATUS_FORBIDDEN || $status === API::RESPOND_UNAUTHORISED) {
+ if ($status === Http::STATUS_FORBIDDEN || $status === OCSController::RESPOND_UNAUTHORISED) {
return Http::STATUS_UNAUTHORIZED;
}
diff --git a/lib/private/AppFramework/OCS/V2Response.php b/lib/private/AppFramework/OCS/V2Response.php
index 3d1868857ce..5a253adf676 100644
--- a/lib/private/AppFramework/OCS/V2Response.php
+++ b/lib/private/AppFramework/OCS/V2Response.php
@@ -24,8 +24,8 @@
namespace OC\AppFramework\OCS;
-use OCP\API;
use OCP\AppFramework\Http;
+use OCP\AppFramework\OCSController;
class V2Response extends BaseResponse {
@@ -37,11 +37,11 @@ class V2Response extends BaseResponse {
*/
public function getStatus() {
$status = parent::getStatus();
- if ($status === API::RESPOND_UNAUTHORISED) {
+ if ($status === OCSController::RESPOND_UNAUTHORISED) {
return Http::STATUS_UNAUTHORIZED;
- } elseif ($status === API::RESPOND_NOT_FOUND) {
+ } elseif ($status === OCSController::RESPOND_NOT_FOUND) {
return Http::STATUS_NOT_FOUND;
- } elseif ($status === API::RESPOND_SERVER_ERROR || $status === API::RESPOND_UNKNOWN_ERROR) {
+ } elseif ($status === OCSController::RESPOND_SERVER_ERROR || $status === OCSController::RESPOND_UNKNOWN_ERROR) {
return Http::STATUS_INTERNAL_SERVER_ERROR;
} elseif ($status < 200 || $status > 600) {
return Http::STATUS_BAD_REQUEST;