From d984c8d6333ffab0ee959f8e75d0834742e62076 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 19 Mar 2018 11:30:35 +0100 Subject: [PATCH 1/2] Remove unused deprecated functions from OCP\JSON Signed-off-by: Roeland Jago Douma --- lib/public/JSON.php | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/lib/public/JSON.php b/lib/public/JSON.php index c56c3b645a..151a590b29 100644 --- a/lib/public/JSON.php +++ b/lib/public/JSON.php @@ -41,18 +41,6 @@ namespace OCP; * @deprecated 8.1.0 Use a AppFramework JSONResponse instead */ class JSON { - /** - * Encode and print $data in JSON format - * @param array $data The data to use - * @param bool $setContentType the optional content type - * @deprecated 8.1.0 Use a AppFramework JSONResponse instead - * - * @suppress PhanDeprecatedFunction - */ - public static function encodedPrint( $data, $setContentType=true ) { - \OC_JSON::encodedPrint($data, $setContentType); - } - /** * Check if the user is logged in, send json error msg if not. * @@ -135,16 +123,6 @@ class JSON { \OC_JSON::error($data); } - /** - * Set Content-Type header to jsonrequest - * @param string $type The content type header - * @deprecated 8.1.0 Use a AppFramework JSONResponse instead - * @suppress PhanDeprecatedFunction - */ - public static function setContentTypeHeader( $type='application/json' ) { - \OC_JSON::setContentTypeHeader($type); - } - /** * Check if the App is enabled and send JSON error message instead * @@ -196,14 +174,4 @@ class JSON { public static function encode($data) { return \OC_JSON::encode($data); } - - /** - * Check is a given user exists - send json error msg if not - * @param string $user - * @deprecated 8.1.0 Use a AppFramework JSONResponse instead - * @suppress PhanDeprecatedFunction - */ - public static function checkUserExists($user) { - \OC_JSON::checkUserExists($user); - } } From 68871caf3ce7b59dc977dd198681b42121ca7259 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 19 Mar 2018 11:32:10 +0100 Subject: [PATCH 2/2] Remove unused private function Signed-off-by: Roeland Jago Douma --- lib/private/legacy/json.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/lib/private/legacy/json.php b/lib/private/legacy/json.php index 0afa179b3d..b02e5c879f 100644 --- a/lib/private/legacy/json.php +++ b/lib/private/legacy/json.php @@ -111,21 +111,6 @@ class OC_JSON{ } } - /** - * Check is a given user exists - send json error msg if not - * @param string $user - * @deprecated Use a AppFramework JSONResponse instead - * @suppress PhanDeprecatedFunction - */ - public static function checkUserExists($user) { - if (!\OC::$server->getUserManager()->userExists($user)) { - $l = \OC::$server->getL10N('lib'); - OCP\JSON::error(array('data' => array('message' => $l->t('Unknown user'), 'error' => 'unknown_user' ))); - exit; - } - } - - /** * Check if the user is a subadmin, send json error msg if not * @deprecated Use annotation based ACLs from the AppFramework instead