Completed
Pull Request — master (#6651)
by Robin
14:37
created
lib/private/Remote/Api/ApiBase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 * @return resource|string
60 60
 	 */
61 61
 	protected function request($method, $url, array $body = [], array $query = [], array $headers = []) {
62
-		$fullUrl = trim($this->instance->getFullUrl(), '/') . '/' . $url;
62
+		$fullUrl = trim($this->instance->getFullUrl(), '/').'/'.$url;
63 63
 		$options = [
64 64
 			'query' => $query,
65 65
 			'headers' => $this->addDefaultHeaders($headers),
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 				$response = $client->options($fullUrl, $options);
89 89
 				break;
90 90
 			default:
91
-				throw new \InvalidArgumentException('Invalid method ' . $method);
91
+				throw new \InvalidArgumentException('Invalid method '.$method);
92 92
 		}
93 93
 
94 94
 		return $response->getBody();
Please login to merge, or discard this patch.
lib/private/Remote/Api/OCS.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	protected function request($method, $url, array $body = [], array $query = [], array $headers = []) {
43 43
 		try {
44
-			$response = json_decode(parent::request($method, '/ocs/v2.php/' . $url, $body, $query, $headers), true);
44
+			$response = json_decode(parent::request($method, '/ocs/v2.php/'.$url, $body, $query, $headers), true);
45 45
 		} catch (ClientException $e) {
46 46
 			if ($e->getResponse()->getStatusCode() === 404) {
47 47
 				throw new NotFoundException();
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
 			throw new NotFoundException();
62 62
 		}
63 63
 		if ($response['ocs']['meta']['status'] !== 'ok') {
64
-			throw new \Exception('Unknown ocs error ' . $response['ocs']['meta']['message']);
64
+			throw new \Exception('Unknown ocs error '.$response['ocs']['meta']['message']);
65 65
 		}
66 66
 
67 67
 		return $response['ocs']['data'];
68 68
 	}
69 69
 
70 70
 	public function getUser($userId) {
71
-		return new User($this->request('get', 'cloud/users/' . $userId));
71
+		return new User($this->request('get', 'cloud/users/'.$userId));
72 72
 	}
73 73
 
74 74
 	/**
Please login to merge, or discard this patch.
lib/private/Remote/Instance.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * @return string The of of the remote server with protocol
64 64
 	 */
65 65
 	public function getFullUrl() {
66
-		return $this->getProtocol() . '://' . $this->getUrl();
66
+		return $this->getProtocol().'://'.$this->getUrl();
67 67
 	}
68 68
 
69 69
 	/**
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
 		if ($this->status) {
97 97
 			return $this->status;
98 98
 		}
99
-		$key = 'remote/' . $this->url . '/status';
99
+		$key = 'remote/'.$this->url.'/status';
100 100
 		$status = $this->cache->get($key);
101 101
 		if (!$status) {
102
-			$response = $this->downloadStatus('https://' . $this->getUrl() . '/status.php');
102
+			$response = $this->downloadStatus('https://'.$this->getUrl().'/status.php');
103 103
 			$protocol = 'https';
104 104
 			if (!$response) {
105
-				$response = $this->downloadStatus('http://' . $this->getUrl() . '/status.php');
105
+				$response = $this->downloadStatus('http://'.$this->getUrl().'/status.php');
106 106
 				$protocol = 'http';
107 107
 			}
108 108
 			$status = json_decode($response, true);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 				$this->cache->set($key, $status, 5 * 60);
114 114
 				$this->status = $status;
115 115
 			} else {
116
-				throw new NotFoundException('Remote server not found at address ' . $this->url);
116
+				throw new NotFoundException('Remote server not found at address '.$this->url);
117 117
 			}
118 118
 		}
119 119
 		return $status;
Please login to merge, or discard this patch.