Passed
Push — master ( 4011a3...bf48c0 )
by Robin
15:13 queued 11s
created
lib/private/Security/CertificateManager.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			return [];
88 88
 		}
89 89
 
90
-		$path = $this->getPathToCertificates() . 'uploads/';
90
+		$path = $this->getPathToCertificates().'uploads/';
91 91
 		if (!$this->view->is_dir($path)) {
92 92
 			return [];
93 93
 		}
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		while (false !== ($file = readdir($handle))) {
100 100
 			if ($file != '.' && $file != '..') {
101 101
 				try {
102
-					$result[] = new Certificate($this->view->file_get_contents($path . $file), $file);
102
+					$result[] = new Certificate($this->view->file_get_contents($path.$file), $file);
103 103
 				} catch (\Exception $e) {
104 104
 				}
105 105
 			}
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 			return false;
114 114
 		}
115 115
 
116
-		$path = $this->getPathToCertificates() . 'uploads/';
116
+		$path = $this->getPathToCertificates().'uploads/';
117 117
 		if (!$this->view->is_dir($path)) {
118 118
 			return false;
119 119
 		}
@@ -142,20 +142,20 @@  discard block
 block discarded – undo
142 142
 			$this->view->mkdir($path);
143 143
 		}
144 144
 
145
-		$defaultCertificates = file_get_contents(\OC::$SERVERROOT . '/resources/config/ca-bundle.crt');
145
+		$defaultCertificates = file_get_contents(\OC::$SERVERROOT.'/resources/config/ca-bundle.crt');
146 146
 		if (strlen($defaultCertificates) < 1024) { // sanity check to verify that we have some content for our bundle
147 147
 			// log as exception so we have a stacktrace
148 148
 			$this->logger->logException(new \Exception('Shipped ca-bundle is empty, refusing to create certificate bundle'));
149 149
 			return;
150 150
 		}
151 151
 
152
-		$certPath = $path . 'rootcerts.crt';
153
-		$tmpPath = $certPath . '.tmp' . $this->random->generate(10, ISecureRandom::CHAR_DIGITS);
152
+		$certPath = $path.'rootcerts.crt';
153
+		$tmpPath = $certPath.'.tmp'.$this->random->generate(10, ISecureRandom::CHAR_DIGITS);
154 154
 		$fhCerts = $this->view->fopen($tmpPath, 'w');
155 155
 
156 156
 		// Write user certificates
157 157
 		foreach ($certs as $cert) {
158
-			$file = $path . '/uploads/' . $cert->getName();
158
+			$file = $path.'/uploads/'.$cert->getName();
159 159
 			$data = $this->view->file_get_contents($file);
160 160
 			if (strpos($data, 'BEGIN CERTIFICATE')) {
161 161
 				fwrite($fhCerts, $data);
@@ -191,13 +191,13 @@  discard block
 block discarded – undo
191 191
 			throw new \Exception('Filename is not valid');
192 192
 		}
193 193
 
194
-		$dir = $this->getPathToCertificates() . 'uploads/';
194
+		$dir = $this->getPathToCertificates().'uploads/';
195 195
 		if (!$this->view->file_exists($dir)) {
196 196
 			$this->view->mkdir($dir);
197 197
 		}
198 198
 
199 199
 		try {
200
-			$file = $dir . $name;
200
+			$file = $dir.$name;
201 201
 			$certificateObject = new Certificate($certificate, $name);
202 202
 			$this->view->file_put_contents($file, $certificate);
203 203
 			$this->createCertificateBundle();
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
 		if (!Filesystem::isValidPath($name)) {
218 218
 			return false;
219 219
 		}
220
-		$path = $this->getPathToCertificates() . 'uploads/';
221
-		if ($this->view->file_exists($path . $name)) {
222
-			$this->view->unlink($path . $name);
220
+		$path = $this->getPathToCertificates().'uploads/';
221
+		if ($this->view->file_exists($path.$name)) {
222
+			$this->view->unlink($path.$name);
223 223
 			$this->createCertificateBundle();
224 224
 		}
225 225
 		return true;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 	 * @return string
232 232
 	 */
233 233
 	public function getCertificateBundle(): string {
234
-		return $this->getPathToCertificates() . 'rootcerts.crt';
234
+		return $this->getPathToCertificates().'rootcerts.crt';
235 235
 	}
236 236
 
237 237
 	/**
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 	public function getAbsoluteBundlePath(): string {
243 243
 		try {
244 244
 			if (!$this->hasCertificates()) {
245
-				return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
245
+				return \OC::$SERVERROOT.'/resources/config/ca-bundle.crt';
246 246
 			}
247 247
 
248 248
 			if ($this->needsRebundling()) {
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 
252 252
 			return $this->view->getLocalFile($this->getCertificateBundle());
253 253
 		} catch (\Exception $e) {
254
-			return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
254
+			return \OC::$SERVERROOT.'/resources/config/ca-bundle.crt';
255 255
 		}
256 256
 	}
257 257
 
@@ -283,6 +283,6 @@  discard block
 block discarded – undo
283 283
 	 * @return int
284 284
 	 */
285 285
 	protected function getFilemtimeOfCaBundle(): int {
286
-		return filemtime(\OC::$SERVERROOT . '/resources/config/ca-bundle.crt');
286
+		return filemtime(\OC::$SERVERROOT.'/resources/config/ca-bundle.crt');
287 287
 	}
288 288
 }
Please login to merge, or discard this patch.
lib/private/Files/ObjectStore/S3ConnectionTrait.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 			throw new \Exception("Bucket has to be configured.");
74 74
 		}
75 75
 
76
-		$this->id = 'amazon::' . $params['bucket'];
76
+		$this->id = 'amazon::'.$params['bucket'];
77 77
 
78 78
 		$this->test = isset($params['test']);
79 79
 		$this->bucket = $params['bucket'];
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 		$this->uploadPartSize = $params['uploadPartSize'] ?? 524288000;
83 83
 		$this->putSizeLimit = $params['putSizeLimit'] ?? 104857600;
84 84
 		$params['region'] = empty($params['region']) ? 'eu-west-1' : $params['region'];
85
-		$params['hostname'] = empty($params['hostname']) ? 's3.' . $params['region'] . '.amazonaws.com' : $params['hostname'];
85
+		$params['hostname'] = empty($params['hostname']) ? 's3.'.$params['region'].'.amazonaws.com' : $params['hostname'];
86 86
 		if (!isset($params['port']) || $params['port'] === '') {
87 87
 			$params['port'] = (isset($params['use_ssl']) && $params['use_ssl'] === false) ? 80 : 443;
88 88
 		}
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 		}
111 111
 
112 112
 		$scheme = (isset($this->params['use_ssl']) && $this->params['use_ssl'] === false) ? 'http' : 'https';
113
-		$base_url = $scheme . '://' . $this->params['hostname'] . ':' . $this->params['port'] . '/';
113
+		$base_url = $scheme.'://'.$this->params['hostname'].':'.$this->params['port'].'/';
114 114
 
115 115
 		// Adding explicit credential provider to the beginning chain.
116 116
 		// Including default credential provider (skipping AWS shared config files).
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 			$certManager = \OC::$server->get(ICertificateManager::class);
128 128
 			$certPath = $certManager->getAbsoluteBundlePath();
129 129
 		} else {
130
-			$certPath = \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
130
+			$certPath = \OC::$SERVERROOT.'/resources/config/ca-bundle.crt';
131 131
 		}
132 132
 
133 133
 		$options = [
@@ -151,16 +151,16 @@  discard block
 block discarded – undo
151 151
 
152 152
 		if (!$this->connection::isBucketDnsCompatible($this->bucket)) {
153 153
 			$logger = \OC::$server->getLogger();
154
-			$logger->debug('Bucket "' . $this->bucket . '" This bucket name is not dns compatible, it may contain invalid characters.',
154
+			$logger->debug('Bucket "'.$this->bucket.'" This bucket name is not dns compatible, it may contain invalid characters.',
155 155
 					 ['app' => 'objectstore']);
156 156
 		}
157 157
 
158 158
 		if ($this->params['verify_bucket_exists'] && !$this->connection->doesBucketExist($this->bucket)) {
159 159
 			$logger = \OC::$server->getLogger();
160 160
 			try {
161
-				$logger->info('Bucket "' . $this->bucket . '" does not exist - creating it.', ['app' => 'objectstore']);
161
+				$logger->info('Bucket "'.$this->bucket.'" does not exist - creating it.', ['app' => 'objectstore']);
162 162
 				if (!$this->connection::isBucketDnsCompatible($this->bucket)) {
163
-					throw new \Exception("The bucket will not be created because the name is not dns compatible, please correct it: " . $this->bucket);
163
+					throw new \Exception("The bucket will not be created because the name is not dns compatible, please correct it: ".$this->bucket);
164 164
 				}
165 165
 				$this->connection->createBucket(['Bucket' => $this->bucket]);
166 166
 				$this->testTimeout();
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 					'level' => ILogger::DEBUG,
171 171
 					'app' => 'objectstore',
172 172
 				]);
173
-				throw new \Exception('Creation of bucket "' . $this->bucket . '" failed. ' . $e->getMessage());
173
+				throw new \Exception('Creation of bucket "'.$this->bucket.'" failed. '.$e->getMessage());
174 174
 			}
175 175
 		}
176 176
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 * This function creates a credential provider based on user parameter file
206 206
 	 */
207 207
 	protected function paramCredentialProvider() : callable {
208
-		return function () {
208
+		return function() {
209 209
 			$key = empty($this->params['key']) ? null : $this->params['key'];
210 210
 			$secret = empty($this->params['secret']) ? null : $this->params['secret'];
211 211
 
Please login to merge, or discard this patch.