Completed
Push — master ( cf3ffb...1a07c5 )
by John
21:12 queued 13s
created
lib/private/Remote/Api/OCS.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	protected function request($method, $url, array $body = [], array $query = [], array $headers = []) {
45 45
 		try {
46
-			$response = json_decode(parent::request($method, 'ocs/v2.php/' . $url, $body, $query, $headers), true);
46
+			$response = json_decode(parent::request($method, 'ocs/v2.php/'.$url, $body, $query, $headers), true);
47 47
 		} catch (ClientException $e) {
48 48
 			if ($e->getResponse()->getStatusCode() === 404) {
49 49
 				throw new NotFoundException();
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 			throw new NotFoundException();
64 64
 		}
65 65
 		if ($response['ocs']['meta']['status'] !== 'ok') {
66
-			throw new \Exception('Unknown ocs error ' . $response['ocs']['meta']['message']);
66
+			throw new \Exception('Unknown ocs error '.$response['ocs']['meta']['message']);
67 67
 		}
68 68
 
69 69
 		return $response['ocs']['data'];
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
 	private function checkResponseArray(array $data, $type, array $keys) {
79 79
 		foreach ($keys as $key) {
80 80
 			if (!array_key_exists($key, $data)) {
81
-				throw new \Exception('Invalid ' . $type . ' response, expected field ' . $key . ' not found');
81
+				throw new \Exception('Invalid '.$type.' response, expected field '.$key.' not found');
82 82
 			}
83 83
 		}
84 84
 	}
85 85
 
86 86
 	public function getUser($userId) {
87
-		$result = $this->request('get', 'cloud/users/' . $userId);
87
+		$result = $this->request('get', 'cloud/users/'.$userId);
88 88
 		$this->checkResponseArray($result, 'user', User::EXPECTED_KEYS);
89 89
 		return new User($result);
90 90
 	}
Please login to merge, or discard this patch.
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -32,70 +32,70 @@
 block discarded – undo
32 32
 use OCP\Remote\Api\IUserApi;
33 33
 
34 34
 class OCS extends ApiBase implements ICapabilitiesApi, IUserApi {
35
-	/**
36
-	 * @param string $method
37
-	 * @param string $url
38
-	 * @param array $body
39
-	 * @param array $query
40
-	 * @param array $headers
41
-	 * @return array
42
-	 * @throws ForbiddenException
43
-	 * @throws NotFoundException
44
-	 * @throws \Exception
45
-	 */
46
-	protected function request($method, $url, array $body = [], array $query = [], array $headers = []) {
47
-		try {
48
-			$response = json_decode(parent::request($method, 'ocs/v2.php/' . $url, $body, $query, $headers), true);
49
-		} catch (ClientException $e) {
50
-			if ($e->getResponse()->getStatusCode() === 404) {
51
-				throw new NotFoundException();
52
-			} elseif ($e->getResponse()->getStatusCode() === 403 || $e->getResponse()->getStatusCode() === 401) {
53
-				throw new ForbiddenException();
54
-			} else {
55
-				throw $e;
56
-			}
57
-		}
58
-		if (!isset($response['ocs']) || !isset($response['ocs']['meta'])) {
59
-			throw new \Exception('Invalid ocs response');
60
-		}
61
-		if ($response['ocs']['meta']['statuscode'] === OCSController::RESPOND_UNAUTHORISED) {
62
-			throw new ForbiddenException();
63
-		}
64
-		if ($response['ocs']['meta']['statuscode'] === OCSController::RESPOND_NOT_FOUND) {
65
-			throw new NotFoundException();
66
-		}
67
-		if ($response['ocs']['meta']['status'] !== 'ok') {
68
-			throw new \Exception('Unknown ocs error ' . $response['ocs']['meta']['message']);
69
-		}
35
+    /**
36
+     * @param string $method
37
+     * @param string $url
38
+     * @param array $body
39
+     * @param array $query
40
+     * @param array $headers
41
+     * @return array
42
+     * @throws ForbiddenException
43
+     * @throws NotFoundException
44
+     * @throws \Exception
45
+     */
46
+    protected function request($method, $url, array $body = [], array $query = [], array $headers = []) {
47
+        try {
48
+            $response = json_decode(parent::request($method, 'ocs/v2.php/' . $url, $body, $query, $headers), true);
49
+        } catch (ClientException $e) {
50
+            if ($e->getResponse()->getStatusCode() === 404) {
51
+                throw new NotFoundException();
52
+            } elseif ($e->getResponse()->getStatusCode() === 403 || $e->getResponse()->getStatusCode() === 401) {
53
+                throw new ForbiddenException();
54
+            } else {
55
+                throw $e;
56
+            }
57
+        }
58
+        if (!isset($response['ocs']) || !isset($response['ocs']['meta'])) {
59
+            throw new \Exception('Invalid ocs response');
60
+        }
61
+        if ($response['ocs']['meta']['statuscode'] === OCSController::RESPOND_UNAUTHORISED) {
62
+            throw new ForbiddenException();
63
+        }
64
+        if ($response['ocs']['meta']['statuscode'] === OCSController::RESPOND_NOT_FOUND) {
65
+            throw new NotFoundException();
66
+        }
67
+        if ($response['ocs']['meta']['status'] !== 'ok') {
68
+            throw new \Exception('Unknown ocs error ' . $response['ocs']['meta']['message']);
69
+        }
70 70
 
71
-		return $response['ocs']['data'];
72
-	}
71
+        return $response['ocs']['data'];
72
+    }
73 73
 
74
-	/**
75
-	 * @param array $data
76
-	 * @param string $type
77
-	 * @param string[] $keys
78
-	 * @throws \Exception
79
-	 */
80
-	private function checkResponseArray(array $data, $type, array $keys) {
81
-		foreach ($keys as $key) {
82
-			if (!array_key_exists($key, $data)) {
83
-				throw new \Exception('Invalid ' . $type . ' response, expected field ' . $key . ' not found');
84
-			}
85
-		}
86
-	}
74
+    /**
75
+     * @param array $data
76
+     * @param string $type
77
+     * @param string[] $keys
78
+     * @throws \Exception
79
+     */
80
+    private function checkResponseArray(array $data, $type, array $keys) {
81
+        foreach ($keys as $key) {
82
+            if (!array_key_exists($key, $data)) {
83
+                throw new \Exception('Invalid ' . $type . ' response, expected field ' . $key . ' not found');
84
+            }
85
+        }
86
+    }
87 87
 
88
-	public function getUser($userId) {
89
-		$result = $this->request('get', 'cloud/users/' . $userId);
90
-		$this->checkResponseArray($result, 'user', User::EXPECTED_KEYS);
91
-		return new User($result);
92
-	}
88
+    public function getUser($userId) {
89
+        $result = $this->request('get', 'cloud/users/' . $userId);
90
+        $this->checkResponseArray($result, 'user', User::EXPECTED_KEYS);
91
+        return new User($result);
92
+    }
93 93
 
94
-	/**
95
-	 * @return array The capabilities in the form of [$appId => [$capability => $value]]
96
-	 */
97
-	public function getCapabilities() {
98
-		$result = $this->request('get', 'cloud/capabilities');
99
-		return $result['capabilities'];
100
-	}
94
+    /**
95
+     * @return array The capabilities in the form of [$appId => [$capability => $value]]
96
+     */
97
+    public function getCapabilities() {
98
+        $result = $this->request('get', 'cloud/capabilities');
99
+        return $result['capabilities'];
100
+    }
101 101
 }
Please login to merge, or discard this patch.
apps/files/composer/composer/autoload_psr4.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'OCA\\Files\\' => array($baseDir . '/../lib'),
9
+    'OCA\\Files\\' => array($baseDir.'/../lib'),
10 10
 );
Please login to merge, or discard this patch.
apps/encryption/composer/composer/autoload_psr4.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'OCA\\Encryption\\' => array($baseDir . '/../lib'),
9
+    'OCA\\Encryption\\' => array($baseDir.'/../lib'),
10 10
 );
Please login to merge, or discard this patch.
apps/federatedfilesharing/composer/composer/autoload_psr4.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'OCA\\FederatedFileSharing\\' => array($baseDir . '/../lib'),
9
+    'OCA\\FederatedFileSharing\\' => array($baseDir.'/../lib'),
10 10
 );
Please login to merge, or discard this patch.
apps/federation/composer/composer/autoload_psr4.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'OCA\\Federation\\' => array($baseDir . '/../lib'),
9
+    'OCA\\Federation\\' => array($baseDir.'/../lib'),
10 10
 );
Please login to merge, or discard this patch.
apps/files_external/composer/composer/autoload_psr4.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'OCA\\Files_External\\' => array($baseDir . '/../lib'),
9
+    'OCA\\Files_External\\' => array($baseDir.'/../lib'),
10 10
 );
Please login to merge, or discard this patch.
apps/lookup_server_connector/composer/composer/autoload_psr4.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'OCA\\LookupServerConnector\\' => array($baseDir . '/../lib'),
9
+    'OCA\\LookupServerConnector\\' => array($baseDir.'/../lib'),
10 10
 );
Please login to merge, or discard this patch.
apps/theming/composer/composer/autoload_psr4.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'OCA\\Theming\\' => array($baseDir . '/../lib'),
9
+    'OCA\\Theming\\' => array($baseDir.'/../lib'),
10 10
 );
Please login to merge, or discard this patch.
apps/oauth2/composer/composer/autoload_psr4.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'OCA\\OAuth2\\' => array($baseDir . '/../lib'),
9
+    'OCA\\OAuth2\\' => array($baseDir.'/../lib'),
10 10
 );
Please login to merge, or discard this patch.