deprecationcheck.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?php
  2. /**
  3. * @author Joas Schilling <nickvergessen@owncloud.com>
  4. *
  5. * @copyright Copyright (c) 2015, ownCloud, Inc.
  6. * @license AGPL-3.0
  7. *
  8. * This code is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License, version 3,
  10. * as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License, version 3,
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>
  19. *
  20. */
  21. namespace OC\App\CodeChecker;
  22. class DeprecationCheck extends AbstractCheck implements ICheck {
  23. /**
  24. * @return string
  25. */
  26. protected function getLocalDescription() {
  27. return 'deprecated';
  28. }
  29. /**
  30. * @return array E.g.: `'ClassName' => 'oc version',`
  31. */
  32. protected function getLocalClasses() {
  33. return [
  34. 'OCP\Config' => '8.0.0',
  35. 'OCP\Contacts' => '8.1.0',
  36. 'OCP\DB' => '8.1.0',
  37. 'OCP\IHelper' => '8.1.0',
  38. 'OCP\JSON' => '8.1.0',
  39. 'OCP\Response' => '8.1.0',
  40. 'OCP\AppFramework\IApi' => '8.0.0',
  41. ];
  42. }
  43. /**
  44. * @return array E.g.: `'ClassName::CONSTANT_NAME' => 'oc version',`
  45. */
  46. protected function getLocalConstants() {
  47. return [
  48. 'OCP::PERMISSION_CREATE' => '8.0.0',
  49. 'OCP::PERMISSION_READ' => '8.0.0',
  50. 'OCP::PERMISSION_UPDATE' => '8.0.0',
  51. 'OCP::PERMISSION_DELETE' => '8.0.0',
  52. 'OCP::PERMISSION_SHARE' => '8.0.0',
  53. 'OCP::PERMISSION_ALL' => '8.0.0',
  54. 'OCP::FILENAME_INVALID_CHARS' => '8.0.0',
  55. ];
  56. }
  57. /**
  58. * @return array E.g.: `'functionName' => 'oc version',`
  59. */
  60. protected function getLocalFunctions() {
  61. return [
  62. 'OCP::image_path' => '8.0.0',
  63. 'OCP::mimetype_icon' => '8.0.0',
  64. 'OCP::preview_icon' => '8.0.0',
  65. 'OCP::publicPreview_icon' => '8.0.0',
  66. 'OCP::human_file_size' => '8.0.0',
  67. 'OCP::relative_modified_date' => '8.0.0',
  68. 'OCP::simple_file_size' => '8.0.0',
  69. 'OCP::html_select_options' => '8.0.0',
  70. ];
  71. }
  72. /**
  73. * @return array E.g.: `'ClassName::methodName' => 'oc version',`
  74. */
  75. protected function getLocalMethods() {
  76. return [
  77. 'OCP\App::register' => '8.1.0',
  78. 'OCP\App::addNavigationEntry' => '8.1.0',
  79. 'OCP\App::setActiveNavigationEntry' => '8.1.0',
  80. 'OCP\AppFramework\Controller::params' => '7.0.0',
  81. 'OCP\AppFramework\Controller::getParams' => '7.0.0',
  82. 'OCP\AppFramework\Controller::method' => '7.0.0',
  83. 'OCP\AppFramework\Controller::getUploadedFile' => '7.0.0',
  84. 'OCP\AppFramework\Controller::env' => '7.0.0',
  85. 'OCP\AppFramework\Controller::cookie' => '7.0.0',
  86. 'OCP\AppFramework\Controller::render' => '7.0.0',
  87. 'OCP\AppFramework\IAppContainer::getCoreApi' => '8.0.0',
  88. 'OCP\AppFramework\IAppContainer::isLoggedIn' => '8.0.0',
  89. 'OCP\AppFramework\IAppContainer::isAdminUser' => '8.0.0',
  90. 'OCP\AppFramework\IAppContainer::log' => '8.0.0',
  91. 'OCP\BackgroundJob::addQueuedTask' => '6.0.0',
  92. 'OCP\BackgroundJob::addRegularTask' => '6.0.0',
  93. 'OCP\BackgroundJob::allQueuedTasks' => '6.0.0',
  94. 'OCP\BackgroundJob::allRegularTasks' => '6.0.0',
  95. 'OCP\BackgroundJob::deleteQueuedTask' => '6.0.0',
  96. 'OCP\BackgroundJob::findQueuedTask' => '6.0.0',
  97. 'OCP\BackgroundJob::queuedTaskWhereAppIs' => '6.0.0',
  98. 'OCP\BackgroundJob::registerJob' => '8.1.0',
  99. 'OCP\Files::tmpFile' => '8.1.0',
  100. 'OCP\Files::tmpFolder' => '8.1.0',
  101. 'OCP\IAppConfig::getValue' => '8.0.0',
  102. 'OCP\IAppConfig::deleteKey' => '8.0.0',
  103. 'OCP\IAppConfig::getKeys' => '8.0.0',
  104. 'OCP\IAppConfig::setValue' => '8.0.0',
  105. 'OCP\IAppConfig::deleteApp' => '8.0.0',
  106. 'OCP\ISearch::search' => '8.0.0',
  107. 'OCP\IServerContainer::getDb' => '8.1.0',
  108. 'OCP\IServerContainer::getHTTPHelper' => '8.1.0',
  109. 'OCP\User::getUser' => '8.0.0',
  110. 'OCP\User::getUsers' => '8.1.0',
  111. 'OCP\User::getDisplayName' => '8.1.0',
  112. 'OCP\User::getDisplayNames' => '8.1.0',
  113. 'OCP\User::userExists' => '8.1.0',
  114. 'OCP\User::logout' => '8.1.0',
  115. 'OCP\User::checkPassword' => '8.1.0',
  116. 'OCP\Util::sendMail' => '8.1.0',
  117. 'OCP\Util::formatDate' => '8.0.0',
  118. 'OCP\Util::encryptedFiles' => '8.1.0',
  119. 'OCP\Util::linkToRoute' => '8.1.0',
  120. 'OCP\Util::linkTo' => '8.1.0',
  121. 'OCP\Util::getServerHost' => '8.1.0',
  122. 'OCP\Util::getServerProtocol' => '8.1.0',
  123. 'OCP\Util::getRequestUri' => '8.1.0',
  124. 'OCP\Util::getScriptName' => '8.1.0',
  125. 'OCP\Util::imagePath' => '8.1.0',
  126. 'OCP\Util::isValidFileName' => '8.1.0',
  127. 'OCP\Util::generateRandomBytes' => '8.1.0',
  128. 'OCP\Util::mb_str_replace' => '8.2.0',
  129. 'OCP\Util::mb_substr_replace' => '8.2.0',
  130. ];
  131. }
  132. }