Completed
Push — master ( 3061fb...bc1b17 )
by Joas
20:34
created
lib/private/Profiler/FileProfilerStorage.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 /**
5 5
  * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
6 6
  * SPDX-License-Identifier: AGPL-3.0-or-later
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		while (\count($result) < $limit && $line = $this->readLineFromFile($file)) {
47 47
 			$values = str_getcsv($line);
48 48
 			[$csvToken, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode] = $values;
49
-			$csvTime = (int)$csvTime;
49
+			$csvTime = (int) $csvTime;
50 50
 
51 51
 			if (($url && !str_contains($csvUrl, $url))
52 52
 				|| ($method && !str_contains($csvMethod, $method))
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 		}
99 99
 
100 100
 		if (\function_exists('gzcompress')) {
101
-			$file = 'compress.zlib://' . $file;
101
+			$file = 'compress.zlib://'.$file;
102 102
 		}
103 103
 
104 104
 		return $this->createProfileFromData($token, unserialize(file_get_contents($file)));
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		// when there are errors in sub-requests, the parent and/or children tokens
124 124
 		// may equal the profile token, resulting in infinite loops
125 125
 		$parentToken = $profile->getParentToken() !== $profileToken ? $profile->getParentToken() : null;
126
-		$childrenToken = array_filter(array_map(function (IProfile $p) use ($profileToken) {
126
+		$childrenToken = array_filter(array_map(function(IProfile $p) use ($profileToken) {
127 127
 			return $profileToken !== $p->getToken() ? $p->getToken() : null;
128 128
 		}, $profile->getChildren()));
129 129
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		$context = stream_context_create();
143 143
 
144 144
 		if (\function_exists('gzcompress')) {
145
-			$file = 'compress.zlib://' . $file;
145
+			$file = 'compress.zlib://'.$file;
146 146
 			stream_context_set_option($context, 'zlib', 'level', 3);
147 147
 		}
148 148
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
 	protected function escapeFormulae(?string $value): ?string {
174 174
 		if ($value !== null && preg_match('/^[=+\-@\t\r]/', $value)) {
175
-			return "'" . $value;
175
+			return "'".$value;
176 176
 		}
177 177
 		return $value;
178 178
 	}
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		$folderA = substr($token, -2, 2);
188 188
 		$folderB = substr($token, -4, 2);
189 189
 
190
-		return $this->folder . '/' . $folderA . '/' . $folderB . '/' . $token;
190
+		return $this->folder.'/'.$folderA.'/'.$folderB.'/'.$token;
191 191
 	}
192 192
 
193 193
 	/**
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	 * @return string The index filename
197 197
 	 */
198 198
 	protected function getIndexFilename(): string {
199
-		return $this->folder . '/index.csv';
199
+		return $this->folder.'/index.csv';
200 200
 	}
201 201
 
202 202
 	/**
@@ -229,12 +229,12 @@  discard block
 block discarded – undo
229 229
 			$buffer = fread($file, $chunkSize);
230 230
 
231 231
 			if (false === ($upTo = strrpos($buffer, "\n"))) {
232
-				$line = $buffer . $line;
232
+				$line = $buffer.$line;
233 233
 				continue;
234 234
 			}
235 235
 
236 236
 			$position += $upTo;
237
-			$line = substr($buffer, $upTo + 1) . $line;
237
+			$line = substr($buffer, $upTo + 1).$line;
238 238
 			fseek($file, max(0, $position), \SEEK_SET);
239 239
 
240 240
 			if ($line !== '') {
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 			}
268 268
 
269 269
 			if (\function_exists('gzcompress')) {
270
-				$file = 'compress.zlib://' . $file;
270
+				$file = 'compress.zlib://'.$file;
271 271
 			}
272 272
 
273 273
 			$profile->addChild($this->createProfileFromData($token, unserialize(file_get_contents($file)), $profile));
Please login to merge, or discard this patch.