summaryrefslogtreecommitdiffstats
path: root/lib/private/app/codechecker/deprecationcheck.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/app/codechecker/deprecationcheck.php')
-rw-r--r--lib/private/app/codechecker/deprecationcheck.php163
1 files changed, 163 insertions, 0 deletions
diff --git a/lib/private/app/codechecker/deprecationcheck.php b/lib/private/app/codechecker/deprecationcheck.php
new file mode 100644
index 00000000000..bac59e4dd7c
--- /dev/null
+++ b/lib/private/app/codechecker/deprecationcheck.php
@@ -0,0 +1,163 @@
+<?php
+/**
+ * @author Joas Schilling <nickvergessen@owncloud.com>
+ *
+ * @copyright Copyright (c) 2015, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+namespace OC\App\CodeChecker;
+
+class DeprecationCheck implements ICheck {
+ /** @var ICheck */
+ protected $check;
+
+ /**
+ * @param ICheck $check
+ */
+ public function __construct(ICheck $check) {
+ $this->check = $check;
+ }
+
+ /**
+ * @return string
+ */
+ public function getDescription() {
+ $innerDescription = $this->check->getDescription();
+ return 'deprecated' . (($innerDescription === '') ? '' : ' ' . $innerDescription);
+ }
+
+ /**
+ * @return array E.g.: `'ClassName' => 'oc version',`
+ */
+ public function getClasses() {
+ return array_merge([
+ 'OCP\Config' => '8.0.0',
+ 'OCP\Contacts' => '8.1.0',
+ 'OCP\DB' => '8.1.0',
+ 'OCP\IHelper' => '8.1.0',
+ 'OCP\JSON' => '8.1.0',
+ 'OCP\Response' => '8.1.0',
+ 'OCP\AppFramework\IApi' => '8.0.0',
+ ], $this->check->getClasses());
+ }
+
+ /**
+ * @return array E.g.: `'ClassName::CONSTANT_NAME' => 'oc version',`
+ */
+ public function getConstants() {
+ return array_merge([
+ 'OCP::PERMISSION_CREATE' => '8.0.0',
+ 'OCP::PERMISSION_READ' => '8.0.0',
+ 'OCP::PERMISSION_UPDATE' => '8.0.0',
+ 'OCP::PERMISSION_DELETE' => '8.0.0',
+ 'OCP::PERMISSION_SHARE' => '8.0.0',
+ 'OCP::PERMISSION_ALL' => '8.0.0',
+ 'OCP::FILENAME_INVALID_CHARS' => '8.0.0',
+ ], $this->check->getConstants());
+ }
+
+ /**
+ * @return array E.g.: `'functionName' => 'oc version',`
+ */
+ public function getFunctions() {
+ return array_merge([
+ 'OCP::image_path' => '8.0.0',
+ 'OCP::mimetype_icon' => '8.0.0',
+ 'OCP::preview_icon' => '8.0.0',
+ 'OCP::publicPreview_icon' => '8.0.0',
+ 'OCP::human_file_size' => '8.0.0',
+ 'OCP::relative_modified_date' => '8.0.0',
+ 'OCP::simple_file_size' => '8.0.0',
+ 'OCP::html_select_options' => '8.0.0',
+ ], $this->check->getFunctions());
+ }
+
+ /**
+ * @return array E.g.: `'ClassName::methodName' => 'oc version',`
+ */
+ public function getMethods() {
+ return array_merge([
+ 'OCP\App::register' => '8.1.0',
+ 'OCP\App::addNavigationEntry' => '8.1.0',
+ 'OCP\App::setActiveNavigationEntry' => '8.1.0',
+
+ 'OCP\AppFramework\Controller::params' => '7.0.0',
+ 'OCP\AppFramework\Controller::getParams' => '7.0.0',
+ 'OCP\AppFramework\Controller::method' => '7.0.0',
+ 'OCP\AppFramework\Controller::getUploadedFile' => '7.0.0',
+ 'OCP\AppFramework\Controller::env' => '7.0.0',
+ 'OCP\AppFramework\Controller::cookie' => '7.0.0',
+ 'OCP\AppFramework\Controller::render' => '7.0.0',
+
+ 'OCP\AppFramework\IAppContainer::getCoreApi' => '8.0.0',
+ 'OCP\AppFramework\IAppContainer::isLoggedIn' => '8.0.0',
+ 'OCP\AppFramework\IAppContainer::isAdminUser' => '8.0.0',
+ 'OCP\AppFramework\IAppContainer::log' => '8.0.0',
+
+ 'OCP\BackgroundJob::addQueuedTask' => '6.0.0',
+ 'OCP\BackgroundJob::addRegularTask' => '6.0.0',
+ 'OCP\BackgroundJob::allQueuedTasks' => '6.0.0',
+ 'OCP\BackgroundJob::allRegularTasks' => '6.0.0',
+ 'OCP\BackgroundJob::deleteQueuedTask' => '6.0.0',
+ 'OCP\BackgroundJob::findQueuedTask' => '6.0.0',
+ 'OCP\BackgroundJob::queuedTaskWhereAppIs' => '6.0.0',
+ 'OCP\BackgroundJob::registerJob' => '8.1.0',
+
+ 'OCP\Files::tmpFile' => '8.1.0',
+ 'OCP\Files::tmpFolder' => '8.1.0',
+
+ 'OCP\IAppConfig::getValue' => '8.0.0',
+ 'OCP\IAppConfig::deleteKey' => '8.0.0',
+ 'OCP\IAppConfig::getKeys' => '8.0.0',
+ 'OCP\IAppConfig::setValue' => '8.0.0',
+ 'OCP\IAppConfig::deleteApp' => '8.0.0',
+
+ 'OCP\ISearch::search' => '8.0.0',
+
+ 'OCP\IServerContainer::getDb' => '8.1.0',
+ 'OCP\IServerContainer::getHTTPHelper' => '8.1.0',
+
+ 'OCP\User::getUser' => '8.0.0',
+ 'OCP\User::getUsers' => '8.1.0',
+ 'OCP\User::getDisplayName' => '8.1.0',
+ 'OCP\User::getDisplayNames' => '8.1.0',
+ 'OCP\User::userExists' => '8.1.0',
+ '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::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',
+ ], $this->check->getMethods());
+ }
+
+ /**
+ * @return bool
+ */
+ public function checkStrongComparisons() {
+ return $this->check->checkStrongComparisons();
+ }
+}