Passed
Push — master ( 9563c7...3a6d81 )
by Morris
12:29 queued 10s
created
lib/public/API.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -40,12 +40,12 @@
 block discarded – undo
40 40
  * @deprecated 9.1.0 Use the AppFramework
41 41
  */
42 42
 class API {
43
-	/**
44
-	 * API Response Codes
45
-	 * @since 8.1.0
46
-	 */
47
-	const RESPOND_UNAUTHORISED = 997;
48
-	const RESPOND_SERVER_ERROR = 996;
49
-	const RESPOND_NOT_FOUND = 998;
50
-	const RESPOND_UNKNOWN_ERROR = 999;
43
+    /**
44
+     * API Response Codes
45
+     * @since 8.1.0
46
+     */
47
+    const RESPOND_UNAUTHORISED = 997;
48
+    const RESPOND_SERVER_ERROR = 996;
49
+    const RESPOND_NOT_FOUND = 998;
50
+    const RESPOND_UNKNOWN_ERROR = 999;
51 51
 }
Please login to merge, or discard this patch.
lib/private/legacy/api.php 2 patches
Indentation   +152 added lines, -152 removed lines patch added patch discarded remove patch
@@ -37,156 +37,156 @@
 block discarded – undo
37 37
 
38 38
 class OC_API {
39 39
 
40
-	/**
41
-	 * api actions
42
-	 */
43
-	protected static $actions = array();
44
-
45
-	/**
46
-	 * respond to a call
47
-	 * @param \OC\OCS\Result $result
48
-	 * @param string $format the format xml|json
49
-	 */
50
-	public static function respond($result, $format='xml') {
51
-		$request = \OC::$server->getRequest();
52
-
53
-		// Send 401 headers if unauthorised
54
-		if($result->getStatusCode() === API::RESPOND_UNAUTHORISED) {
55
-			// If request comes from JS return dummy auth request
56
-			if($request->getHeader('X-Requested-With') === 'XMLHttpRequest') {
57
-				header('WWW-Authenticate: DummyBasic realm="Authorisation Required"');
58
-			} else {
59
-				header('WWW-Authenticate: Basic realm="Authorisation Required"');
60
-			}
61
-			http_response_code(401);
62
-		}
63
-
64
-		foreach($result->getHeaders() as $name => $value) {
65
-			header($name . ': ' . $value);
66
-		}
67
-
68
-		$meta = $result->getMeta();
69
-		$data = $result->getData();
70
-		if (self::isV2($request)) {
71
-			$statusCode = self::mapStatusCodes($result->getStatusCode());
72
-			if (!is_null($statusCode)) {
73
-				$meta['statuscode'] = $statusCode;
74
-				http_response_code($statusCode);
75
-			}
76
-		}
77
-
78
-		self::setContentType($format);
79
-		$body = self::renderResult($format, $meta, $data);
80
-		echo $body;
81
-	}
82
-
83
-	/**
84
-	 * @param XMLWriter $writer
85
-	 */
86
-	private static function toXML($array, $writer) {
87
-		foreach($array as $k => $v) {
88
-			if ($k[0] === '@') {
89
-				$writer->writeAttribute(substr($k, 1), $v);
90
-				continue;
91
-			} else if (is_numeric($k)) {
92
-				$k = 'element';
93
-			}
94
-			if(is_array($v)) {
95
-				$writer->startElement($k);
96
-				self::toXML($v, $writer);
97
-				$writer->endElement();
98
-			} else {
99
-				$writer->writeElement($k, $v);
100
-			}
101
-		}
102
-	}
103
-
104
-	/**
105
-	 * @return string
106
-	 */
107
-	public static function requestedFormat() {
108
-		$formats = array('json', 'xml');
109
-
110
-		$format = !empty($_GET['format']) && in_array($_GET['format'], $formats) ? $_GET['format'] : 'xml';
111
-		return $format;
112
-	}
113
-
114
-	/**
115
-	 * Based on the requested format the response content type is set
116
-	 * @param string $format
117
-	 */
118
-	public static function setContentType($format = null) {
119
-		$format = is_null($format) ? self::requestedFormat() : $format;
120
-		if ($format === 'xml') {
121
-			header('Content-type: text/xml; charset=UTF-8');
122
-			return;
123
-		}
124
-
125
-		if ($format === 'json') {
126
-			header('Content-Type: application/json; charset=utf-8');
127
-			return;
128
-		}
129
-
130
-		header('Content-Type: application/octet-stream; charset=utf-8');
131
-	}
132
-
133
-	/**
134
-	 * @param \OCP\IRequest $request
135
-	 * @return bool
136
-	 */
137
-	protected static function isV2(\OCP\IRequest $request) {
138
-		$script = $request->getScriptName();
139
-
140
-		return substr($script, -11) === '/ocs/v2.php';
141
-	}
142
-
143
-	/**
144
-	 * @param integer $sc
145
-	 * @return int
146
-	 */
147
-	public static function mapStatusCodes($sc) {
148
-		switch ($sc) {
149
-			case API::RESPOND_NOT_FOUND:
150
-				return Http::STATUS_NOT_FOUND;
151
-			case API::RESPOND_SERVER_ERROR:
152
-				return Http::STATUS_INTERNAL_SERVER_ERROR;
153
-			case API::RESPOND_UNKNOWN_ERROR:
154
-				return Http::STATUS_INTERNAL_SERVER_ERROR;
155
-			case API::RESPOND_UNAUTHORISED:
156
-				// already handled for v1
157
-				return null;
158
-			case 100:
159
-				return Http::STATUS_OK;
160
-		}
161
-		// any 2xx, 4xx and 5xx will be used as is
162
-		if ($sc >= 200 && $sc < 600) {
163
-			return $sc;
164
-		}
165
-
166
-		return Http::STATUS_BAD_REQUEST;
167
-	}
168
-
169
-	/**
170
-	 * @param string $format
171
-	 * @return string
172
-	 */
173
-	public static function renderResult($format, $meta, $data) {
174
-		$response = array(
175
-			'ocs' => array(
176
-				'meta' => $meta,
177
-				'data' => $data,
178
-			),
179
-		);
180
-		if ($format == 'json') {
181
-			return OC_JSON::encode($response);
182
-		}
183
-
184
-		$writer = new XMLWriter();
185
-		$writer->openMemory();
186
-		$writer->setIndent(true);
187
-		$writer->startDocument();
188
-		self::toXML($response, $writer);
189
-		$writer->endDocument();
190
-		return $writer->outputMemory(true);
191
-	}
40
+    /**
41
+     * api actions
42
+     */
43
+    protected static $actions = array();
44
+
45
+    /**
46
+     * respond to a call
47
+     * @param \OC\OCS\Result $result
48
+     * @param string $format the format xml|json
49
+     */
50
+    public static function respond($result, $format='xml') {
51
+        $request = \OC::$server->getRequest();
52
+
53
+        // Send 401 headers if unauthorised
54
+        if($result->getStatusCode() === API::RESPOND_UNAUTHORISED) {
55
+            // If request comes from JS return dummy auth request
56
+            if($request->getHeader('X-Requested-With') === 'XMLHttpRequest') {
57
+                header('WWW-Authenticate: DummyBasic realm="Authorisation Required"');
58
+            } else {
59
+                header('WWW-Authenticate: Basic realm="Authorisation Required"');
60
+            }
61
+            http_response_code(401);
62
+        }
63
+
64
+        foreach($result->getHeaders() as $name => $value) {
65
+            header($name . ': ' . $value);
66
+        }
67
+
68
+        $meta = $result->getMeta();
69
+        $data = $result->getData();
70
+        if (self::isV2($request)) {
71
+            $statusCode = self::mapStatusCodes($result->getStatusCode());
72
+            if (!is_null($statusCode)) {
73
+                $meta['statuscode'] = $statusCode;
74
+                http_response_code($statusCode);
75
+            }
76
+        }
77
+
78
+        self::setContentType($format);
79
+        $body = self::renderResult($format, $meta, $data);
80
+        echo $body;
81
+    }
82
+
83
+    /**
84
+     * @param XMLWriter $writer
85
+     */
86
+    private static function toXML($array, $writer) {
87
+        foreach($array as $k => $v) {
88
+            if ($k[0] === '@') {
89
+                $writer->writeAttribute(substr($k, 1), $v);
90
+                continue;
91
+            } else if (is_numeric($k)) {
92
+                $k = 'element';
93
+            }
94
+            if(is_array($v)) {
95
+                $writer->startElement($k);
96
+                self::toXML($v, $writer);
97
+                $writer->endElement();
98
+            } else {
99
+                $writer->writeElement($k, $v);
100
+            }
101
+        }
102
+    }
103
+
104
+    /**
105
+     * @return string
106
+     */
107
+    public static function requestedFormat() {
108
+        $formats = array('json', 'xml');
109
+
110
+        $format = !empty($_GET['format']) && in_array($_GET['format'], $formats) ? $_GET['format'] : 'xml';
111
+        return $format;
112
+    }
113
+
114
+    /**
115
+     * Based on the requested format the response content type is set
116
+     * @param string $format
117
+     */
118
+    public static function setContentType($format = null) {
119
+        $format = is_null($format) ? self::requestedFormat() : $format;
120
+        if ($format === 'xml') {
121
+            header('Content-type: text/xml; charset=UTF-8');
122
+            return;
123
+        }
124
+
125
+        if ($format === 'json') {
126
+            header('Content-Type: application/json; charset=utf-8');
127
+            return;
128
+        }
129
+
130
+        header('Content-Type: application/octet-stream; charset=utf-8');
131
+    }
132
+
133
+    /**
134
+     * @param \OCP\IRequest $request
135
+     * @return bool
136
+     */
137
+    protected static function isV2(\OCP\IRequest $request) {
138
+        $script = $request->getScriptName();
139
+
140
+        return substr($script, -11) === '/ocs/v2.php';
141
+    }
142
+
143
+    /**
144
+     * @param integer $sc
145
+     * @return int
146
+     */
147
+    public static function mapStatusCodes($sc) {
148
+        switch ($sc) {
149
+            case API::RESPOND_NOT_FOUND:
150
+                return Http::STATUS_NOT_FOUND;
151
+            case API::RESPOND_SERVER_ERROR:
152
+                return Http::STATUS_INTERNAL_SERVER_ERROR;
153
+            case API::RESPOND_UNKNOWN_ERROR:
154
+                return Http::STATUS_INTERNAL_SERVER_ERROR;
155
+            case API::RESPOND_UNAUTHORISED:
156
+                // already handled for v1
157
+                return null;
158
+            case 100:
159
+                return Http::STATUS_OK;
160
+        }
161
+        // any 2xx, 4xx and 5xx will be used as is
162
+        if ($sc >= 200 && $sc < 600) {
163
+            return $sc;
164
+        }
165
+
166
+        return Http::STATUS_BAD_REQUEST;
167
+    }
168
+
169
+    /**
170
+     * @param string $format
171
+     * @return string
172
+     */
173
+    public static function renderResult($format, $meta, $data) {
174
+        $response = array(
175
+            'ocs' => array(
176
+                'meta' => $meta,
177
+                'data' => $data,
178
+            ),
179
+        );
180
+        if ($format == 'json') {
181
+            return OC_JSON::encode($response);
182
+        }
183
+
184
+        $writer = new XMLWriter();
185
+        $writer->openMemory();
186
+        $writer->setIndent(true);
187
+        $writer->startDocument();
188
+        self::toXML($response, $writer);
189
+        $writer->endDocument();
190
+        return $writer->outputMemory(true);
191
+    }
192 192
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -47,13 +47,13 @@  discard block
 block discarded – undo
47 47
 	 * @param \OC\OCS\Result $result
48 48
 	 * @param string $format the format xml|json
49 49
 	 */
50
-	public static function respond($result, $format='xml') {
50
+	public static function respond($result, $format = 'xml') {
51 51
 		$request = \OC::$server->getRequest();
52 52
 
53 53
 		// Send 401 headers if unauthorised
54
-		if($result->getStatusCode() === API::RESPOND_UNAUTHORISED) {
54
+		if ($result->getStatusCode() === API::RESPOND_UNAUTHORISED) {
55 55
 			// If request comes from JS return dummy auth request
56
-			if($request->getHeader('X-Requested-With') === 'XMLHttpRequest') {
56
+			if ($request->getHeader('X-Requested-With') === 'XMLHttpRequest') {
57 57
 				header('WWW-Authenticate: DummyBasic realm="Authorisation Required"');
58 58
 			} else {
59 59
 				header('WWW-Authenticate: Basic realm="Authorisation Required"');
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 			http_response_code(401);
62 62
 		}
63 63
 
64
-		foreach($result->getHeaders() as $name => $value) {
65
-			header($name . ': ' . $value);
64
+		foreach ($result->getHeaders() as $name => $value) {
65
+			header($name.': '.$value);
66 66
 		}
67 67
 
68 68
 		$meta = $result->getMeta();
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
 	 * @param XMLWriter $writer
85 85
 	 */
86 86
 	private static function toXML($array, $writer) {
87
-		foreach($array as $k => $v) {
87
+		foreach ($array as $k => $v) {
88 88
 			if ($k[0] === '@') {
89 89
 				$writer->writeAttribute(substr($k, 1), $v);
90 90
 				continue;
91 91
 			} else if (is_numeric($k)) {
92 92
 				$k = 'element';
93 93
 			}
94
-			if(is_array($v)) {
94
+			if (is_array($v)) {
95 95
 				$writer->startElement($k);
96 96
 				self::toXML($v, $writer);
97 97
 				$writer->endElement();
Please login to merge, or discard this patch.
lib/private/App/CodeChecker/DeprecationCheck.php 1 patch
Indentation   +170 added lines, -170 removed lines patch added patch discarded remove patch
@@ -24,174 +24,174 @@
 block discarded – undo
24 24
 namespace OC\App\CodeChecker;
25 25
 
26 26
 class DeprecationCheck extends AbstractCheck {
27
-	/**
28
-	 * @return string
29
-	 */
30
-	protected function getLocalDescription() {
31
-		return 'deprecated';
32
-	}
33
-
34
-	/**
35
-	 * @return array E.g.: `'ClassName' => 'oc version',`
36
-	 */
37
-	protected function getLocalClasses() {
38
-		return [
39
-			'OC_JSON' => '8.2.0',
40
-
41
-			'OCP\API' => '9.1.0',
42
-			'OCP\Contacts' => '8.1.0',
43
-			'OCP\DB' => '8.1.0',
44
-			'OCP\JSON' => '8.1.0',
45
-			'OCP\Response' => '8.1.0',
46
-			'OCP\AppFramework\IApi' => '8.0.0',
47
-			'OCP\User' => '13.0.0',
48
-			'OCP\BackgroundJob' => '14.0.0',
49
-			'OCP\App' => '14.0.0',
50
-			'OCP\Files' => '14.0.0',
51
-		];
52
-	}
53
-
54
-	/**
55
-	 * @return array E.g.: `'ClassName::CONSTANT_NAME' => 'oc version',`
56
-	 */
57
-	protected function getLocalConstants() {
58
-		return [
59
-			'OCP\API::GUEST_AUTH' => '9.1.0',
60
-			'OCP\API::USER_AUTH' => '9.1.0',
61
-			'OCP\API::SUBADMIN_AUTH' => '9.1.0',
62
-			'OCP\API::ADMIN_AUTH' => '9.1.0',
63
-			'OCP\API::RESPOND_UNAUTHORISED' => '9.1.0',
64
-			'OCP\API::RESPOND_SERVER_ERROR' => '9.1.0',
65
-			'OCP\API::RESPOND_NOT_FOUND' => '9.1.0',
66
-			'OCP\API::RESPOND_UNKNOWN_ERROR' => '9.1.0',
67
-
68
-			'OC_API::GUEST_AUTH' => '8.2.0',
69
-			'OC_API::USER_AUTH' => '8.2.0',
70
-			'OC_API::SUBADMIN_AUTH' => '8.2.0',
71
-			'OC_API::ADMIN_AUTH' => '8.2.0',
72
-			'OC_API::RESPOND_UNAUTHORISED' => '8.2.0',
73
-			'OC_API::RESPOND_SERVER_ERROR' => '8.2.0',
74
-			'OC_API::RESPOND_NOT_FOUND' => '8.2.0',
75
-			'OC_API::RESPOND_UNKNOWN_ERROR' => '8.2.0',
76
-
77
-			'OCP::PERMISSION_CREATE' => '8.0.0',
78
-			'OCP::PERMISSION_READ' => '8.0.0',
79
-			'OCP::PERMISSION_UPDATE' => '8.0.0',
80
-			'OCP::PERMISSION_DELETE' => '8.0.0',
81
-			'OCP::PERMISSION_SHARE' => '8.0.0',
82
-			'OCP::PERMISSION_ALL' => '8.0.0',
83
-			'OCP::FILENAME_INVALID_CHARS' => '8.0.0',
84
-		];
85
-	}
86
-
87
-	/**
88
-	 * @return array E.g.: `'functionName' => 'oc version',`
89
-	 */
90
-	protected function getLocalFunctions() {
91
-		return [
92
-			'OCP::image_path' => '8.0.0',
93
-			'OCP::mimetype_icon' => '8.0.0',
94
-			'OCP::preview_icon' => '8.0.0',
95
-			'OCP::publicPreview_icon' => '8.0.0',
96
-			'OCP::human_file_size' => '8.0.0',
97
-			'OCP::relative_modified_date' => '8.0.0',
98
-			'OCP::simple_file_size' => '8.0.0',
99
-			'OCP::html_select_options' => '8.0.0',
100
-		];
101
-	}
102
-
103
-	/**
104
-	 * @return array E.g.: `'ClassName::methodName' => 'oc version',`
105
-	 */
106
-	protected function getLocalMethods() {
107
-		return [
108
-			'OC_L10N::get' => '8.2.0',
109
-
110
-			'OCP\Activity\IManager::publishActivity' => '8.2.0',
111
-
112
-			'OCP\App::register' => '8.1.0',
113
-			'OCP\App::addNavigationEntry' => '8.1.0',
114
-			'OCP\App::getActiveNavigationEntry' => '8.2.0',
115
-			'OCP\App::setActiveNavigationEntry' => '8.1.0',
116
-			'OCP\App::registerPersonal' => '14.0.0',
117
-			'OCP\App::registerAdmin' => '14.0.0',
118
-			'OC_App::getAppInfo' => '14.0.0',
119
-			'OCP\App::getAppInfo' => '14.0.0',
120
-			'OC_App::getAppVersion' => '14.0.0',
121
-			'OCP\App::getAppVersion' => '14.0.0',
122
-			'OCP\App::registerPersonal' => '14.0.0',
123
-
124
-			'OCP\AppFramework\Controller::params' => '7.0.0',
125
-			'OCP\AppFramework\Controller::getParams' => '7.0.0',
126
-			'OCP\AppFramework\Controller::method' => '7.0.0',
127
-			'OCP\AppFramework\Controller::getUploadedFile' => '7.0.0',
128
-			'OCP\AppFramework\Controller::env' => '7.0.0',
129
-			'OCP\AppFramework\Controller::cookie' => '7.0.0',
130
-			'OCP\AppFramework\Controller::render' => '7.0.0',
131
-
132
-			'OCP\AppFramework\IAppContainer::getCoreApi' => '8.0.0',
133
-			'OCP\AppFramework\IAppContainer::isLoggedIn' => '8.0.0',
134
-			'OCP\AppFramework\IAppContainer::isAdminUser' => '8.0.0',
135
-			'OCP\AppFramework\IAppContainer::log' => '8.0.0',
136
-
137
-			'OCP\BackgroundJob::registerJob' => '8.1.0',
138
-			'OCP\BackgroundJob::getExecutionType' => '14.0.0',
139
-			'OCP\BackgroundJob::setExecutionType' => '14.0.0',
140
-
141
-			'OCP\Files::tmpFile' => '8.1.0',
142
-			'OCP\Files::tmpFolder' => '8.1.0',
143
-
144
-			'OCP\IAppConfig::getValue' => '8.0.0',
145
-			'OCP\IAppConfig::deleteKey' => '8.0.0',
146
-			'OCP\IAppConfig::getKeys' => '8.0.0',
147
-			'OCP\IAppConfig::setValue' => '8.0.0',
148
-			'OCP\IAppConfig::deleteApp' => '8.0.0',
149
-
150
-			'OCP\IDBConnection::createQueryBuilder' => '8.2.0',
151
-			'OCP\IDBConnection::getExpressionBuilder' => '8.2.0',
152
-
153
-			'OCP\ISearch::search' => '8.0.0',
154
-
155
-			'OCP\IServerContainer::getCache' => '8.2.0',
156
-			'OCP\IServerContainer::getDb' => '8.1.0',
157
-			'OCP\IServerContainer::getHTTPHelper' => '8.1.0',
158
-
159
-			'OCP\Response::disableCaching' => '14.0.0',
160
-
161
-			'OCP\User::getUser' => '8.0.0',
162
-			'OCP\User::getUsers' => '8.1.0',
163
-			'OCP\User::getDisplayName' => '8.1.0',
164
-			'OCP\User::getDisplayNames' => '8.1.0',
165
-			'OCP\User::userExists' => '8.1.0',
166
-			'OCP\User::logout' => '8.1.0',
167
-			'OCP\User::checkPassword' => '8.1.0',
168
-			'OCP\User::isLoggedIn' => '13.0.0',
169
-			'OCP\User::checkAdminUser' => '13.0.0',
170
-			'OCP\User::checkLoggedIn' => '13.0.0',
171
-
172
-			'OCP\Util::encryptedFiles' => '8.1.0',
173
-			'OCP\Util::formatDate' => '8.0.0',
174
-			'OCP\Util::generateRandomBytes' => '8.1.0',
175
-			'OCP\Util::getServerHost' => '8.1.0',
176
-			'OCP\Util::getServerProtocol' => '8.1.0',
177
-			'OCP\Util::getRequestUri' => '8.1.0',
178
-			'OCP\Util::getScriptName' => '8.1.0',
179
-			'OCP\Util::imagePath' => '8.1.0',
180
-			'OCP\Util::isValidFileName' => '8.1.0',
181
-			'OCP\Util::linkToRoute' => '8.1.0',
182
-			'OCP\Util::linkTo' => '8.1.0',
183
-			'OCP\Util::logException' => '8.2.0',
184
-			'OCP\Util::mb_str_replace' => '8.2.0',
185
-			'OCP\Util::mb_substr_replace' => '8.2.0',
186
-			'OCP\Util::sendMail' => '8.1.0',
187
-			'OCP\Util::writeLog' => '13.0.0',
188
-
189
-			'OCP\Files::rmdirr' => '14.0.0',
190
-			'OCP\Files::getMimeType' => '14.0.0',
191
-			'OCP\Files::searchByMime' => '14.0.0',
192
-			'OCP\Files::streamCopy' => '14.0.0',
193
-			'OCP\Files::buildNotExistingFileName' => '14.0.0',
194
-			'OCP\Files::getStorage' => '14.0.0',
195
-		];
196
-	}
27
+    /**
28
+     * @return string
29
+     */
30
+    protected function getLocalDescription() {
31
+        return 'deprecated';
32
+    }
33
+
34
+    /**
35
+     * @return array E.g.: `'ClassName' => 'oc version',`
36
+     */
37
+    protected function getLocalClasses() {
38
+        return [
39
+            'OC_JSON' => '8.2.0',
40
+
41
+            'OCP\API' => '9.1.0',
42
+            'OCP\Contacts' => '8.1.0',
43
+            'OCP\DB' => '8.1.0',
44
+            'OCP\JSON' => '8.1.0',
45
+            'OCP\Response' => '8.1.0',
46
+            'OCP\AppFramework\IApi' => '8.0.0',
47
+            'OCP\User' => '13.0.0',
48
+            'OCP\BackgroundJob' => '14.0.0',
49
+            'OCP\App' => '14.0.0',
50
+            'OCP\Files' => '14.0.0',
51
+        ];
52
+    }
53
+
54
+    /**
55
+     * @return array E.g.: `'ClassName::CONSTANT_NAME' => 'oc version',`
56
+     */
57
+    protected function getLocalConstants() {
58
+        return [
59
+            'OCP\API::GUEST_AUTH' => '9.1.0',
60
+            'OCP\API::USER_AUTH' => '9.1.0',
61
+            'OCP\API::SUBADMIN_AUTH' => '9.1.0',
62
+            'OCP\API::ADMIN_AUTH' => '9.1.0',
63
+            'OCP\API::RESPOND_UNAUTHORISED' => '9.1.0',
64
+            'OCP\API::RESPOND_SERVER_ERROR' => '9.1.0',
65
+            'OCP\API::RESPOND_NOT_FOUND' => '9.1.0',
66
+            'OCP\API::RESPOND_UNKNOWN_ERROR' => '9.1.0',
67
+
68
+            'OC_API::GUEST_AUTH' => '8.2.0',
69
+            'OC_API::USER_AUTH' => '8.2.0',
70
+            'OC_API::SUBADMIN_AUTH' => '8.2.0',
71
+            'OC_API::ADMIN_AUTH' => '8.2.0',
72
+            'OC_API::RESPOND_UNAUTHORISED' => '8.2.0',
73
+            'OC_API::RESPOND_SERVER_ERROR' => '8.2.0',
74
+            'OC_API::RESPOND_NOT_FOUND' => '8.2.0',
75
+            'OC_API::RESPOND_UNKNOWN_ERROR' => '8.2.0',
76
+
77
+            'OCP::PERMISSION_CREATE' => '8.0.0',
78
+            'OCP::PERMISSION_READ' => '8.0.0',
79
+            'OCP::PERMISSION_UPDATE' => '8.0.0',
80
+            'OCP::PERMISSION_DELETE' => '8.0.0',
81
+            'OCP::PERMISSION_SHARE' => '8.0.0',
82
+            'OCP::PERMISSION_ALL' => '8.0.0',
83
+            'OCP::FILENAME_INVALID_CHARS' => '8.0.0',
84
+        ];
85
+    }
86
+
87
+    /**
88
+     * @return array E.g.: `'functionName' => 'oc version',`
89
+     */
90
+    protected function getLocalFunctions() {
91
+        return [
92
+            'OCP::image_path' => '8.0.0',
93
+            'OCP::mimetype_icon' => '8.0.0',
94
+            'OCP::preview_icon' => '8.0.0',
95
+            'OCP::publicPreview_icon' => '8.0.0',
96
+            'OCP::human_file_size' => '8.0.0',
97
+            'OCP::relative_modified_date' => '8.0.0',
98
+            'OCP::simple_file_size' => '8.0.0',
99
+            'OCP::html_select_options' => '8.0.0',
100
+        ];
101
+    }
102
+
103
+    /**
104
+     * @return array E.g.: `'ClassName::methodName' => 'oc version',`
105
+     */
106
+    protected function getLocalMethods() {
107
+        return [
108
+            'OC_L10N::get' => '8.2.0',
109
+
110
+            'OCP\Activity\IManager::publishActivity' => '8.2.0',
111
+
112
+            'OCP\App::register' => '8.1.0',
113
+            'OCP\App::addNavigationEntry' => '8.1.0',
114
+            'OCP\App::getActiveNavigationEntry' => '8.2.0',
115
+            'OCP\App::setActiveNavigationEntry' => '8.1.0',
116
+            'OCP\App::registerPersonal' => '14.0.0',
117
+            'OCP\App::registerAdmin' => '14.0.0',
118
+            'OC_App::getAppInfo' => '14.0.0',
119
+            'OCP\App::getAppInfo' => '14.0.0',
120
+            'OC_App::getAppVersion' => '14.0.0',
121
+            'OCP\App::getAppVersion' => '14.0.0',
122
+            'OCP\App::registerPersonal' => '14.0.0',
123
+
124
+            'OCP\AppFramework\Controller::params' => '7.0.0',
125
+            'OCP\AppFramework\Controller::getParams' => '7.0.0',
126
+            'OCP\AppFramework\Controller::method' => '7.0.0',
127
+            'OCP\AppFramework\Controller::getUploadedFile' => '7.0.0',
128
+            'OCP\AppFramework\Controller::env' => '7.0.0',
129
+            'OCP\AppFramework\Controller::cookie' => '7.0.0',
130
+            'OCP\AppFramework\Controller::render' => '7.0.0',
131
+
132
+            'OCP\AppFramework\IAppContainer::getCoreApi' => '8.0.0',
133
+            'OCP\AppFramework\IAppContainer::isLoggedIn' => '8.0.0',
134
+            'OCP\AppFramework\IAppContainer::isAdminUser' => '8.0.0',
135
+            'OCP\AppFramework\IAppContainer::log' => '8.0.0',
136
+
137
+            'OCP\BackgroundJob::registerJob' => '8.1.0',
138
+            'OCP\BackgroundJob::getExecutionType' => '14.0.0',
139
+            'OCP\BackgroundJob::setExecutionType' => '14.0.0',
140
+
141
+            'OCP\Files::tmpFile' => '8.1.0',
142
+            'OCP\Files::tmpFolder' => '8.1.0',
143
+
144
+            'OCP\IAppConfig::getValue' => '8.0.0',
145
+            'OCP\IAppConfig::deleteKey' => '8.0.0',
146
+            'OCP\IAppConfig::getKeys' => '8.0.0',
147
+            'OCP\IAppConfig::setValue' => '8.0.0',
148
+            'OCP\IAppConfig::deleteApp' => '8.0.0',
149
+
150
+            'OCP\IDBConnection::createQueryBuilder' => '8.2.0',
151
+            'OCP\IDBConnection::getExpressionBuilder' => '8.2.0',
152
+
153
+            'OCP\ISearch::search' => '8.0.0',
154
+
155
+            'OCP\IServerContainer::getCache' => '8.2.0',
156
+            'OCP\IServerContainer::getDb' => '8.1.0',
157
+            'OCP\IServerContainer::getHTTPHelper' => '8.1.0',
158
+
159
+            'OCP\Response::disableCaching' => '14.0.0',
160
+
161
+            'OCP\User::getUser' => '8.0.0',
162
+            'OCP\User::getUsers' => '8.1.0',
163
+            'OCP\User::getDisplayName' => '8.1.0',
164
+            'OCP\User::getDisplayNames' => '8.1.0',
165
+            'OCP\User::userExists' => '8.1.0',
166
+            'OCP\User::logout' => '8.1.0',
167
+            'OCP\User::checkPassword' => '8.1.0',
168
+            'OCP\User::isLoggedIn' => '13.0.0',
169
+            'OCP\User::checkAdminUser' => '13.0.0',
170
+            'OCP\User::checkLoggedIn' => '13.0.0',
171
+
172
+            'OCP\Util::encryptedFiles' => '8.1.0',
173
+            'OCP\Util::formatDate' => '8.0.0',
174
+            'OCP\Util::generateRandomBytes' => '8.1.0',
175
+            'OCP\Util::getServerHost' => '8.1.0',
176
+            'OCP\Util::getServerProtocol' => '8.1.0',
177
+            'OCP\Util::getRequestUri' => '8.1.0',
178
+            'OCP\Util::getScriptName' => '8.1.0',
179
+            'OCP\Util::imagePath' => '8.1.0',
180
+            'OCP\Util::isValidFileName' => '8.1.0',
181
+            'OCP\Util::linkToRoute' => '8.1.0',
182
+            'OCP\Util::linkTo' => '8.1.0',
183
+            'OCP\Util::logException' => '8.2.0',
184
+            'OCP\Util::mb_str_replace' => '8.2.0',
185
+            'OCP\Util::mb_substr_replace' => '8.2.0',
186
+            'OCP\Util::sendMail' => '8.1.0',
187
+            'OCP\Util::writeLog' => '13.0.0',
188
+
189
+            'OCP\Files::rmdirr' => '14.0.0',
190
+            'OCP\Files::getMimeType' => '14.0.0',
191
+            'OCP\Files::searchByMime' => '14.0.0',
192
+            'OCP\Files::streamCopy' => '14.0.0',
193
+            'OCP\Files::buildNotExistingFileName' => '14.0.0',
194
+            'OCP\Files::getStorage' => '14.0.0',
195
+        ];
196
+    }
197 197
 }
Please login to merge, or discard this patch.