DeprecationCheck.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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\Contacts' => '8.1.0',
  38. 'OCP\DB' => '8.1.0',
  39. 'OCP\JSON' => '8.1.0',
  40. 'OCP\Response' => '8.1.0',
  41. 'OCP\AppFramework\IApi' => '8.0.0',
  42. 'OCP\User' => '13.0.0',
  43. 'OCP\BackgroundJob' => '14.0.0',
  44. 'OCP\App' => '14.0.0',
  45. 'OCP\Files' => '14.0.0',
  46. ];
  47. }
  48. /**
  49. * @return array E.g.: `'ClassName::CONSTANT_NAME' => 'oc version',`
  50. */
  51. protected function getLocalConstants() {
  52. return [
  53. 'OC_API::GUEST_AUTH' => '8.2.0',
  54. 'OC_API::USER_AUTH' => '8.2.0',
  55. 'OC_API::SUBADMIN_AUTH' => '8.2.0',
  56. 'OC_API::ADMIN_AUTH' => '8.2.0',
  57. 'OC_API::RESPOND_UNAUTHORISED' => '8.2.0',
  58. 'OC_API::RESPOND_SERVER_ERROR' => '8.2.0',
  59. 'OC_API::RESPOND_NOT_FOUND' => '8.2.0',
  60. 'OC_API::RESPOND_UNKNOWN_ERROR' => '8.2.0',
  61. 'OCP::PERMISSION_CREATE' => '8.0.0',
  62. 'OCP::PERMISSION_READ' => '8.0.0',
  63. 'OCP::PERMISSION_UPDATE' => '8.0.0',
  64. 'OCP::PERMISSION_DELETE' => '8.0.0',
  65. 'OCP::PERMISSION_SHARE' => '8.0.0',
  66. 'OCP::PERMISSION_ALL' => '8.0.0',
  67. 'OCP::FILENAME_INVALID_CHARS' => '8.0.0',
  68. ];
  69. }
  70. /**
  71. * @return array E.g.: `'functionName' => 'oc version',`
  72. */
  73. protected function getLocalFunctions() {
  74. return [
  75. 'OCP::image_path' => '8.0.0',
  76. 'OCP::mimetype_icon' => '8.0.0',
  77. 'OCP::preview_icon' => '8.0.0',
  78. 'OCP::publicPreview_icon' => '8.0.0',
  79. 'OCP::human_file_size' => '8.0.0',
  80. 'OCP::relative_modified_date' => '8.0.0',
  81. 'OCP::simple_file_size' => '8.0.0',
  82. 'OCP::html_select_options' => '8.0.0',
  83. ];
  84. }
  85. /**
  86. * @return array E.g.: `'ClassName::methodName' => 'oc version',`
  87. */
  88. protected function getLocalMethods() {
  89. return [
  90. 'OC_L10N::get' => '8.2.0',
  91. 'OCP\Activity\IManager::publishActivity' => '8.2.0',
  92. 'OCP\App::register' => '8.1.0',
  93. 'OCP\App::addNavigationEntry' => '8.1.0',
  94. 'OCP\App::getActiveNavigationEntry' => '8.2.0',
  95. 'OCP\App::setActiveNavigationEntry' => '8.1.0',
  96. 'OCP\App::registerPersonal' => '14.0.0',
  97. 'OCP\App::registerAdmin' => '14.0.0',
  98. 'OC_App::getAppInfo' => '14.0.0',
  99. 'OCP\App::getAppInfo' => '14.0.0',
  100. 'OC_App::getAppVersion' => '14.0.0',
  101. 'OCP\App::getAppVersion' => '14.0.0',
  102. 'OCP\App::registerPersonal' => '14.0.0',
  103. 'OCP\AppFramework\Controller::params' => '7.0.0',
  104. 'OCP\AppFramework\Controller::getParams' => '7.0.0',
  105. 'OCP\AppFramework\Controller::method' => '7.0.0',
  106. 'OCP\AppFramework\Controller::getUploadedFile' => '7.0.0',
  107. 'OCP\AppFramework\Controller::env' => '7.0.0',
  108. 'OCP\AppFramework\Controller::cookie' => '7.0.0',
  109. 'OCP\AppFramework\Controller::render' => '7.0.0',
  110. 'OCP\AppFramework\IAppContainer::getCoreApi' => '8.0.0',
  111. 'OCP\AppFramework\IAppContainer::isLoggedIn' => '8.0.0',
  112. 'OCP\AppFramework\IAppContainer::isAdminUser' => '8.0.0',
  113. 'OCP\AppFramework\IAppContainer::log' => '8.0.0',
  114. 'OCP\BackgroundJob::registerJob' => '8.1.0',
  115. 'OCP\BackgroundJob::getExecutionType' => '14.0.0',
  116. 'OCP\BackgroundJob::setExecutionType' => '14.0.0',
  117. 'OCP\Files::tmpFile' => '8.1.0',
  118. 'OCP\Files::tmpFolder' => '8.1.0',
  119. 'OCP\IAppConfig::getValue' => '8.0.0',
  120. 'OCP\IAppConfig::deleteKey' => '8.0.0',
  121. 'OCP\IAppConfig::getKeys' => '8.0.0',
  122. 'OCP\IAppConfig::setValue' => '8.0.0',
  123. 'OCP\IAppConfig::deleteApp' => '8.0.0',
  124. 'OCP\IDBConnection::createQueryBuilder' => '8.2.0',
  125. 'OCP\IDBConnection::getExpressionBuilder' => '8.2.0',
  126. 'OCP\ISearch::search' => '8.0.0',
  127. 'OCP\IServerContainer::getCache' => '8.2.0',
  128. 'OCP\IServerContainer::getDb' => '8.1.0',
  129. 'OCP\IServerContainer::getHTTPHelper' => '8.1.0',
  130. 'OCP\Response::disableCaching' => '14.0.0',
  131. 'OCP\User::getUser' => '8.0.0',
  132. 'OCP\User::getUsers' => '8.1.0',
  133. 'OCP\User::getDisplayName' => '8.1.0',
  134. 'OCP\User::getDisplayNames' => '8.1.0',
  135. 'OCP\User::userExists' => '8.1.0',
  136. 'OCP\User::logout' => '8.1.0',
  137. 'OCP\User::checkPassword' => '8.1.0',
  138. 'OCP\User::isLoggedIn' => '13.0.0',
  139. 'OCP\User::checkAdminUser' => '13.0.0',
  140. 'OCP\User::checkLoggedIn' => '13.0.0',
  141. 'OCP\Util::encryptedFiles' => '8.1.0',
  142. 'OCP\Util::formatDate' => '8.0.0',
  143. 'OCP\Util::generateRandomBytes' => '8.1.0',
  144. 'OCP\Util::getServerHost' => '8.1.0',
  145. 'OCP\Util::getServerProtocol' => '8.1.0',
  146. 'OCP\Util::getRequestUri' => '8.1.0',
  147. 'OCP\Util::getScriptName' => '8.1.0',
  148. 'OCP\Util::imagePath' => '8.1.0',
  149. 'OCP\Util::isValidFileName' => '8.1.0',
  150. 'OCP\Util::linkToRoute' => '8.1.0',
  151. 'OCP\Util::linkTo' => '8.1.0',
  152. 'OCP\Util::logException' => '8.2.0',
  153. 'OCP\Util::mb_str_replace' => '8.2.0',
  154. 'OCP\Util::mb_substr_replace' => '8.2.0',
  155. 'OCP\Util::sendMail' => '8.1.0',
  156. 'OCP\Util::writeLog' => '13.0.0',
  157. 'OCP\Files::rmdirr' => '14.0.0',
  158. 'OCP\Files::getMimeType' => '14.0.0',
  159. 'OCP\Files::searchByMime' => '14.0.0',
  160. 'OCP\Files::streamCopy' => '14.0.0',
  161. 'OCP\Files::buildNotExistingFileName' => '14.0.0',
  162. 'OCP\Files::getStorage' => '14.0.0',
  163. ];
  164. }
  165. }