diff --git a/lib/private/app/codechecker/deprecationcheck.php b/lib/private/app/codechecker/deprecationcheck.php index 3b6dc968bb..1d287edc85 100644 --- a/lib/private/app/codechecker/deprecationcheck.php +++ b/lib/private/app/codechecker/deprecationcheck.php @@ -34,6 +34,8 @@ class DeprecationCheck extends AbstractCheck implements ICheck { */ protected function getLocalClasses() { return [ + 'OC_JSON' => '8.2.0', + 'OCP\Config' => '8.0.0', 'OCP\Contacts' => '8.1.0', 'OCP\DB' => '8.1.0', @@ -49,6 +51,15 @@ class DeprecationCheck extends AbstractCheck implements ICheck { */ protected function getLocalConstants() { return [ + 'OC_API::GUEST_AUTH' => '8.2.0', + 'OC_API::USER_AUTH' => '8.2.0', + 'OC_API::SUBADMIN_AUTH' => '8.2.0', + 'OC_API::ADMIN_AUTH' => '8.2.0', + 'OC_API::RESPOND_UNAUTHORISED' => '8.2.0', + 'OC_API::RESPOND_SERVER_ERROR' => '8.2.0', + 'OC_API::RESPOND_NOT_FOUND' => '8.2.0', + 'OC_API::RESPOND_UNKNOWN_ERROR' => '8.2.0', + 'OCP::PERMISSION_CREATE' => '8.0.0', 'OCP::PERMISSION_READ' => '8.0.0', 'OCP::PERMISSION_UPDATE' => '8.0.0', @@ -80,8 +91,13 @@ class DeprecationCheck extends AbstractCheck implements ICheck { */ protected function getLocalMethods() { return [ + 'OC_L10N::get' => '8.2.0', + + 'OCP\Activity\IManager::publishActivity' => '8.2.0', + 'OCP\App::register' => '8.1.0', 'OCP\App::addNavigationEntry' => '8.1.0', + 'OCP\App::getActiveNavigationEntry' => '8.2.0', 'OCP\App::setActiveNavigationEntry' => '8.1.0', 'OCP\AppFramework\Controller::params' => '7.0.0', @@ -115,8 +131,12 @@ class DeprecationCheck extends AbstractCheck implements ICheck { 'OCP\IAppConfig::setValue' => '8.0.0', 'OCP\IAppConfig::deleteApp' => '8.0.0', + 'OCP\IDBConnection::createQueryBuilder' => '8.2.0', + 'OCP\IDBConnection::getExpressionBuilder' => '8.2.0', + 'OCP\ISearch::search' => '8.0.0', + 'OCP\IServerContainer::getCache' => '8.2.0', 'OCP\IServerContainer::getDb' => '8.1.0', 'OCP\IServerContainer::getHTTPHelper' => '8.1.0', @@ -128,20 +148,21 @@ class DeprecationCheck extends AbstractCheck implements ICheck { 'OCP\User::logout' => '8.1.0', 'OCP\User::checkPassword' => '8.1.0', - 'OCP\Util::sendMail' => '8.1.0', - 'OCP\Util::formatDate' => '8.0.0', 'OCP\Util::encryptedFiles' => '8.1.0', - 'OCP\Util::linkToRoute' => '8.1.0', - 'OCP\Util::linkTo' => '8.1.0', + 'OCP\Util::formatDate' => '8.0.0', + 'OCP\Util::generateRandomBytes' => '8.1.0', 'OCP\Util::getServerHost' => '8.1.0', 'OCP\Util::getServerProtocol' => '8.1.0', 'OCP\Util::getRequestUri' => '8.1.0', 'OCP\Util::getScriptName' => '8.1.0', 'OCP\Util::imagePath' => '8.1.0', 'OCP\Util::isValidFileName' => '8.1.0', - 'OCP\Util::generateRandomBytes' => '8.1.0', + 'OCP\Util::linkToRoute' => '8.1.0', + 'OCP\Util::linkTo' => '8.1.0', + 'OCP\Util::logException' => '8.2.0', 'OCP\Util::mb_str_replace' => '8.2.0', 'OCP\Util::mb_substr_replace' => '8.2.0', + 'OCP\Util::sendMail' => '8.1.0', ]; } } diff --git a/lib/private/util.php b/lib/private/util.php index 9ea355f016..05f10aef1e 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1300,12 +1300,11 @@ class OC_Util { /** * Get URL content * @param string $url Url to get content - * @deprecated Use \OC::$server->getHTTPHelper()->getUrlContent($url); * @throws Exception If the URL does not start with http:// or https:// * @return string of the response or false on error * This function get the content of a page via curl, if curl is enabled. * If not, file_get_contents is used. - * @deprecated Use \OCP\Http\Client\IClientService + * @deprecated Use \OC::$server->getHTTPClientService()->newClient()->get($url); */ public static function getUrlContent($url) { try { diff --git a/tests/data/app/code-checker/test-const.php b/tests/data/app/code-checker/test-const.php index 2af6baf2f3..7ea3bd6c87 100644 --- a/tests/data/app/code-checker/test-const.php +++ b/tests/data/app/code-checker/test-const.php @@ -5,6 +5,6 @@ */ class BadClass { public function foo() { - $bar = OC_API::ADMIN_AUTH; + $bar = \OC_API::ADMIN_AUTH; } } diff --git a/tests/lib/app/codechecker/deprecationchecktest.php b/tests/lib/app/codechecker/deprecationchecktest.php index 2cf64a9d18..ee69f075a6 100644 --- a/tests/lib/app/codechecker/deprecationchecktest.php +++ b/tests/lib/app/codechecker/deprecationchecktest.php @@ -38,6 +38,7 @@ class DeprecationCheckTest extends TestCase { ['OCP\AppFramework\IApi', 1006, 'test-deprecated-use-alias.php'], ['AppFramework\IApi', 1001, 'test-deprecated-use-sub.php'], ['OAF\IApi', 1001, 'test-deprecated-use-sub-alias.php'], + ['OC_API::ADMIN_AUTH', 1003, 'test-const.php'], ]; } @@ -61,7 +62,6 @@ class DeprecationCheckTest extends TestCase { ['test-extends.php'], ['test-implements.php'], ['test-static-call.php'], - ['test-const.php'], ['test-new.php'], ['test-use.php'], ['test-identical-operator.php'],