You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

196 lines
6.2 KiB

3 years ago
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Joas Schilling <coding@schilljs.com>
  6. * @author Morris Jobke <hey@morrisjobke.de>
  7. *
  8. * @license AGPL-3.0
  9. *
  10. * This code is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License, version 3,
  12. * as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License, version 3,
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>
  21. *
  22. */
  23. namespace OC\App\CodeChecker;
  24. class DeprecationCheck extends AbstractCheck {
  25. /**
  26. * @return string
  27. */
  28. protected function getLocalDescription() {
  29. return 'deprecated';
  30. }
  31. /**
  32. * @return array E.g.: `'ClassName' => 'oc version',`
  33. */
  34. protected function getLocalClasses() {
  35. return [
  36. 'OC_JSON' => '8.2.0',
  37. 'OCP\API' => '9.1.0',
  38. 'OCP\Contacts' => '8.1.0',
  39. 'OCP\DB' => '8.1.0',
  40. 'OCP\JSON' => '8.1.0',
  41. 'OCP\Response' => '8.1.0',
  42. 'OCP\AppFramework\IApi' => '8.0.0',
  43. 'OCP\User' => '13.0.0',
  44. 'OCP\BackgroundJob' => '14.0.0',
  45. 'OCP\App' => '14.0.0',
  46. 'OCP\Files' => '14.0.0',
  47. ];
  48. }
  49. /**
  50. * @return array E.g.: `'ClassName::CONSTANT_NAME' => 'oc version',`
  51. */
  52. protected function getLocalConstants() {
  53. return [
  54. 'OCP\API::GUEST_AUTH' => '9.1.0',
  55. 'OCP\API::USER_AUTH' => '9.1.0',
  56. 'OCP\API::SUBADMIN_AUTH' => '9.1.0',
  57. 'OCP\API::ADMIN_AUTH' => '9.1.0',
  58. 'OCP\API::RESPOND_UNAUTHORISED' => '9.1.0',
  59. 'OCP\API::RESPOND_SERVER_ERROR' => '9.1.0',
  60. 'OCP\API::RESPOND_NOT_FOUND' => '9.1.0',
  61. 'OCP\API::RESPOND_UNKNOWN_ERROR' => '9.1.0',
  62. 'OC_API::GUEST_AUTH' => '8.2.0',
  63. 'OC_API::USER_AUTH' => '8.2.0',
  64. 'OC_API::SUBADMIN_AUTH' => '8.2.0',
  65. 'OC_API::ADMIN_AUTH' => '8.2.0',
  66. 'OC_API::RESPOND_UNAUTHORISED' => '8.2.0',
  67. 'OC_API::RESPOND_SERVER_ERROR' => '8.2.0',
  68. 'OC_API::RESPOND_NOT_FOUND' => '8.2.0',
  69. 'OC_API::RESPOND_UNKNOWN_ERROR' => '8.2.0',
  70. 'OCP::PERMISSION_CREATE' => '8.0.0',
  71. 'OCP::PERMISSION_READ' => '8.0.0',
  72. 'OCP::PERMISSION_UPDATE' => '8.0.0',
  73. 'OCP::PERMISSION_DELETE' => '8.0.0',
  74. 'OCP::PERMISSION_SHARE' => '8.0.0',
  75. 'OCP::PERMISSION_ALL' => '8.0.0',
  76. 'OCP::FILENAME_INVALID_CHARS' => '8.0.0',
  77. ];
  78. }
  79. /**
  80. * @return array E.g.: `'functionName' => 'oc version',`
  81. */
  82. protected function getLocalFunctions() {
  83. return [
  84. 'OCP::image_path' => '8.0.0',
  85. 'OCP::mimetype_icon' => '8.0.0',
  86. 'OCP::preview_icon' => '8.0.0',
  87. 'OCP::publicPreview_icon' => '8.0.0',
  88. 'OCP::human_file_size' => '8.0.0',
  89. 'OCP::relative_modified_date' => '8.0.0',
  90. 'OCP::simple_file_size' => '8.0.0',
  91. 'OCP::html_select_options' => '8.0.0',
  92. ];
  93. }
  94. /**
  95. * @return array E.g.: `'ClassName::methodName' => 'oc version',`
  96. */
  97. protected function getLocalMethods() {
  98. return [
  99. 'OC_L10N::get' => '8.2.0',
  100. 'OCP\Activity\IManager::publishActivity' => '8.2.0',
  101. 'OCP\App::register' => '8.1.0',
  102. 'OCP\App::addNavigationEntry' => '8.1.0',
  103. 'OCP\App::getActiveNavigationEntry' => '8.2.0',
  104. 'OCP\App::setActiveNavigationEntry' => '8.1.0',
  105. 'OCP\App::registerPersonal' => '14.0.0',
  106. 'OCP\App::registerAdmin' => '14.0.0',
  107. 'OC_App::getAppInfo' => '14.0.0',
  108. 'OCP\App::getAppInfo' => '14.0.0',
  109. 'OC_App::getAppVersion' => '14.0.0',
  110. 'OCP\App::getAppVersion' => '14.0.0',
  111. 'OCP\AppFramework\Controller::params' => '7.0.0',
  112. 'OCP\AppFramework\Controller::getParams' => '7.0.0',
  113. 'OCP\AppFramework\Controller::method' => '7.0.0',
  114. 'OCP\AppFramework\Controller::getUploadedFile' => '7.0.0',
  115. 'OCP\AppFramework\Controller::env' => '7.0.0',
  116. 'OCP\AppFramework\Controller::cookie' => '7.0.0',
  117. 'OCP\AppFramework\Controller::render' => '7.0.0',
  118. 'OCP\AppFramework\IAppContainer::getCoreApi' => '8.0.0',
  119. 'OCP\AppFramework\IAppContainer::isLoggedIn' => '8.0.0',
  120. 'OCP\AppFramework\IAppContainer::isAdminUser' => '8.0.0',
  121. 'OCP\AppFramework\IAppContainer::log' => '8.0.0',
  122. 'OCP\BackgroundJob::registerJob' => '8.1.0',
  123. 'OCP\BackgroundJob::getExecutionType' => '14.0.0',
  124. 'OCP\BackgroundJob::setExecutionType' => '14.0.0',
  125. 'OCP\Files::tmpFile' => '8.1.0',
  126. 'OCP\Files::tmpFolder' => '8.1.0',
  127. 'OCP\IAppConfig::getValue' => '8.0.0',
  128. 'OCP\IAppConfig::deleteKey' => '8.0.0',
  129. 'OCP\IAppConfig::getKeys' => '8.0.0',
  130. 'OCP\IAppConfig::setValue' => '8.0.0',
  131. 'OCP\IAppConfig::deleteApp' => '8.0.0',
  132. 'OCP\IDBConnection::createQueryBuilder' => '8.2.0',
  133. 'OCP\IDBConnection::getExpressionBuilder' => '8.2.0',
  134. 'OCP\ISearch::search' => '8.0.0',
  135. 'OCP\IServerContainer::getCache' => '8.2.0',
  136. 'OCP\IServerContainer::getDb' => '8.1.0',
  137. 'OCP\IServerContainer::getHTTPHelper' => '8.1.0',
  138. 'OCP\Response::disableCaching' => '14.0.0',
  139. 'OCP\User::getUser' => '8.0.0',
  140. 'OCP\User::getUsers' => '8.1.0',
  141. 'OCP\User::getDisplayName' => '8.1.0',
  142. 'OCP\User::getDisplayNames' => '8.1.0',
  143. 'OCP\User::userExists' => '8.1.0',
  144. 'OCP\User::logout' => '8.1.0',
  145. 'OCP\User::checkPassword' => '8.1.0',
  146. 'OCP\User::isLoggedIn' => '13.0.0',
  147. 'OCP\User::checkAdminUser' => '13.0.0',
  148. 'OCP\User::checkLoggedIn' => '13.0.0',
  149. 'OCP\Util::encryptedFiles' => '8.1.0',
  150. 'OCP\Util::formatDate' => '8.0.0',
  151. 'OCP\Util::generateRandomBytes' => '8.1.0',
  152. 'OCP\Util::getServerHost' => '8.1.0',
  153. 'OCP\Util::getServerProtocol' => '8.1.0',
  154. 'OCP\Util::getRequestUri' => '8.1.0',
  155. 'OCP\Util::getScriptName' => '8.1.0',
  156. 'OCP\Util::imagePath' => '8.1.0',
  157. 'OCP\Util::isValidFileName' => '8.1.0',
  158. 'OCP\Util::linkToRoute' => '8.1.0',
  159. 'OCP\Util::linkTo' => '8.1.0',
  160. 'OCP\Util::logException' => '8.2.0',
  161. 'OCP\Util::mb_str_replace' => '8.2.0',
  162. 'OCP\Util::mb_substr_replace' => '8.2.0',
  163. 'OCP\Util::sendMail' => '8.1.0',
  164. 'OCP\Util::writeLog' => '13.0.0',
  165. 'OCP\Files::rmdirr' => '14.0.0',
  166. 'OCP\Files::getMimeType' => '14.0.0',
  167. 'OCP\Files::searchByMime' => '14.0.0',
  168. 'OCP\Files::streamCopy' => '14.0.0',
  169. 'OCP\Files::buildNotExistingFileName' => '14.0.0',
  170. 'OCP\Files::getStorage' => '14.0.0',
  171. ];
  172. }
  173. }