Completed
Push — master ( 45934f...3af419 )
by Blizzz
21s
created
lib/Tools/Traits/TNCLocalSignatory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
 	 */
82 82
 	public function createSimpleSignatory(NCSignatory $signatory): void {
83 83
 		$app = $this->setup('app', '', self::$SIGNATORIES_APP);
84
-		$signatory->setKeyId($signatory->getId() . '#main-key');
84
+		$signatory->setKeyId($signatory->getId().'#main-key');
85 85
 		$signatory->setKeyOwner($signatory->getId());
86 86
 		$this->generateKeys($signatory);
87 87
 
Please login to merge, or discard this patch.
lib/Tools/Traits/TStringTools.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 			return $line;
97 97
 		}
98 98
 
99
-		return substr($line, 0, $length - 5) . ' (..)';
99
+		return substr($line, 0, $length - 5).' (..)';
100 100
 	}
101 101
 
102 102
 	/**
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	protected function feedStringWithParams(string $line, array $params): string {
135 135
 		$ak = array_keys($params);
136 136
 		foreach ($ak as $k) {
137
-			$line = str_replace('{' . $k . '}', (string)$params[$k], $line);
137
+			$line = str_replace('{'.$k.'}', (string)$params[$k], $line);
138 138
 		}
139 139
 
140 140
 		return $line;
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 		$s = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
189 189
 		$e = floor(log($bytes, 1024));
190 190
 
191
-		return round($bytes / pow(1024, $e), 2) . ' ' . $s[$e];
191
+		return round($bytes / pow(1024, $e), 2).' '.$s[$e];
192 192
 	}
193 193
 
194 194
 
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
 			$second = time();
212 212
 		}
213 213
 
214
-		$f = new DateTime('@' . $first);
215
-		$s = new DateTime('@' . $second);
214
+		$f = new DateTime('@'.$first);
215
+		$s = new DateTime('@'.$second);
216 216
 		$duration = $second - $first;
217 217
 		if ($short) {
218 218
 			$minutes = $this->get('minutes', $words, 'M');
@@ -220,16 +220,16 @@  discard block
 block discarded – undo
220 220
 			$days = $this->get('days', $words, 'D');
221 221
 
222 222
 			if ($duration < 60) {
223
-				return $f->diff($s)->format('<1' . $minutes);
223
+				return $f->diff($s)->format('<1'.$minutes);
224 224
 			}
225 225
 			if ($duration < 3600) {
226
-				return $f->diff($s)->format('%i' . $minutes);
226
+				return $f->diff($s)->format('%i'.$minutes);
227 227
 			}
228 228
 			if ($duration < 86400) {
229
-				return $f->diff($s)->format('%h' . $hours . ', %i' . $minutes);
229
+				return $f->diff($s)->format('%h'.$hours.', %i'.$minutes);
230 230
 			}
231 231
 
232
-			return $f->diff($s)->format('%a' . $days . ', %h' . $hours . ', %i' . $minutes);
232
+			return $f->diff($s)->format('%a'.$days.', %h'.$hours.', %i'.$minutes);
233 233
 		}
234 234
 
235 235
 		$seconds = $this->get('seconds', $words, 'seconds');
@@ -237,22 +237,22 @@  discard block
 block discarded – undo
237 237
 		$hours = $this->get('hours', $words, 'hours');
238 238
 		$days = $this->get('days', $words, 'days');
239 239
 		if ($duration < 60) {
240
-			return $f->diff($s)->format('%s ' . $seconds);
240
+			return $f->diff($s)->format('%s '.$seconds);
241 241
 		}
242 242
 
243 243
 		if ($duration < 3600) {
244
-			return $f->diff($s)->format('%i ' . $minutes . ' and %s ' . $seconds);
244
+			return $f->diff($s)->format('%i '.$minutes.' and %s '.$seconds);
245 245
 		}
246 246
 
247 247
 		if ($duration < 86400) {
248
-			return $f->diff($s)->format('%h ' . $hours . ', %i ' . $minutes . ' and %s ' . $seconds);
248
+			return $f->diff($s)->format('%h '.$hours.', %i '.$minutes.' and %s '.$seconds);
249 249
 		}
250 250
 
251 251
 		return $f->diff($s)->format(
252
-			'%a ' . $days .
253
-			', %h ' . $hours .
254
-			', %i ' . $minutes .
255
-			' and %s ' . $seconds
252
+			'%a '.$days.
253
+			', %h '.$hours.
254
+			', %i '.$minutes.
255
+			' and %s '.$seconds
256 256
 		);
257 257
 	}
258 258
 }
Please login to merge, or discard this patch.
lib/Tools/Traits/TConsoleTree.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
 				for ($i = 0; $i < $config['node-spacing']; $i++) {
105 105
 					$spacing = substr($empty, 0, -3);
106 106
 					if (substr($spacing, -1) === ' ') {
107
-						$spacing = substr($spacing, 0, -1) . '│';
107
+						$spacing = substr($spacing, 0, -1).'│';
108 108
 					}
109 109
 					$output->writeln($spacing);
110 110
 				}
Please login to merge, or discard this patch.
lib/Tools/Traits/TArrayTools.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 		foreach ($keys as $key) {
405 405
 			if (!array_key_exists($key, $arr)) {
406 406
 				throw new MalformedArrayException(
407
-					'source: ' . json_encode($arr) . ' - missing key: ' . $key
407
+					'source: '.json_encode($arr).' - missing key: '.$key
408 408
 				);
409 409
 			}
410 410
 		}
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 	protected function cleanArray(array &$arr) {
418 418
 		$arr = array_filter(
419 419
 			$arr,
420
-			function ($v) {
420
+			function($v) {
421 421
 				if (is_string($v)) {
422 422
 					return ($v !== '');
423 423
 				}
Please login to merge, or discard this patch.
lib/Tools/Traits/TNCSignatory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			$this->updateSignatory($signatory, $this->retrieveJson($request), $keyId);
96 96
 		} catch (RequestNetworkException $e) {
97 97
 			$this->debug('network issue while downloading Signatory', ['request' => $request]);
98
-			throw new SignatoryException('network issue: ' . $e->getMessage());
98
+			throw new SignatoryException('network issue: '.$e->getMessage());
99 99
 		}
100 100
 	}
101 101
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 			return $host;
142 142
 		}
143 143
 
144
-		throw new InvalidOriginException('cannot retrieve origin from ' . $keyId);
144
+		throw new InvalidOriginException('cannot retrieve origin from '.$keyId);
145 145
 	}
146 146
 
147 147
 
Please login to merge, or discard this patch.
lib/Tools/Traits/TAsync.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 		echo($result);
64 64
 
65 65
 		$size = ob_get_length();
66
-		header('Content-Length: ' . $size);
66
+		header('Content-Length: '.$size);
67 67
 		ob_end_flush();
68 68
 		flush();
69 69
 	}
Please login to merge, or discard this patch.
lib/Tools/Traits/TNCLogger.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 * @param array $serializable
131 131
 	 */
132 132
 	public function emergency(string $message, bool $trace = false, array $serializable = []): void {
133
-		$this->log(self::$EMERGENCY, '[emergency] ' . $message, $trace, $serializable);
133
+		$this->log(self::$EMERGENCY, '[emergency] '.$message, $trace, $serializable);
134 134
 	}
135 135
 
136 136
 	/**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 * @param array $serializable
140 140
 	 */
141 141
 	public function alert(string $message, bool $trace = false, array $serializable = []): void {
142
-		$this->log(self::$ALERT, '[alert] ' . $message, $trace, $serializable);
142
+		$this->log(self::$ALERT, '[alert] '.$message, $trace, $serializable);
143 143
 	}
144 144
 
145 145
 	/**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 * @param array $serializable
149 149
 	 */
150 150
 	public function warning(string $message, bool $trace = false, array $serializable = []): void {
151
-		$this->log(self::$WARNING, '[warning] ' . $message, $trace, $serializable);
151
+		$this->log(self::$WARNING, '[warning] '.$message, $trace, $serializable);
152 152
 	}
153 153
 
154 154
 	/**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @param array $serializable
158 158
 	 */
159 159
 	public function notice(string $message, bool $trace = false, array $serializable = []): void {
160
-		$this->log(self::$NOTICE, '[notice] ' . $message, $trace, $serializable);
160
+		$this->log(self::$NOTICE, '[notice] '.$message, $trace, $serializable);
161 161
 	}
162 162
 
163 163
 	/**
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 * @param array $serializable
166 166
 	 */
167 167
 	public function debug(string $message, array $serializable = []): void {
168
-		$message = '[debug] ' . $message;
168
+		$message = '[debug] '.$message;
169 169
 		$debugLevel = (int)$this->appConfig('debug_level');
170 170
 		$this->log($debugLevel, $message, ($this->appConfig('debug_trace') === '1'), $serializable);
171 171
 	}
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 		if ($trace) {
183 183
 			$opts['exception'] = new HintException($message, json_encode($serializable));
184 184
 		} elseif (!empty($serializable)) {
185
-			$message .= ' -- ' . json_encode($serializable);
185
+			$message .= ' -- '.json_encode($serializable);
186 186
 		}
187 187
 
188 188
 		$this->logger()
Please login to merge, or discard this patch.
lib/Tools/Traits/TDeserialize.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
 	 */
67 67
 	public function deserialize(array $data, string $class): IDeserializable {
68 68
 		if ($class instanceof IDeserializable) {
69
-			throw new InvalidItemException(get_class($class) . ' does not implement IDeserializable');
69
+			throw new InvalidItemException(get_class($class).' does not implement IDeserializable');
70 70
 		}
71 71
 
72 72
 		/** @var IDeserializable $item */
Please login to merge, or discard this patch.
lib/Tools/ActivityPub/NCSignature.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
 			throw new SignatureException('missing elements in \'headers\'');
220 220
 		}
221 221
 
222
-		$target = strtolower($request->getMethod()) . " " . $request->getRequestUri();
223
-		$estimated = ['(request-target): ' . $target];
222
+		$target = strtolower($request->getMethod())." ".$request->getRequestUri();
223
+		$estimated = ['(request-target): '.$target];
224 224
 
225 225
 		foreach ($headers as $key) {
226 226
 			$value = $request->getHeader($key);
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 				throw new SignatureException('empty elements in \'headers\'');
232 232
 			}
233 233
 
234
-			$estimated[] = $key . ': ' . $value;
234
+			$estimated[] = $key.': '.$value;
235 235
 		}
236 236
 		$signedRequest->setClearSignature(implode("\n", $estimated));
237 237
 	}
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 		$request = $signedRequest->getOutgoingRequest();
304 304
 
305 305
 		$data = new SimpleDataStore();
306
-		$data->s('(request-target)', NCRequest::method($request->getType()) . ' ' . $request->getPath())
306
+		$data->s('(request-target)', NCRequest::method($request->getType()).' '.$request->getPath())
307 307
 			 ->sInt('content-length', strlen($signedRequest->getBody()))
308 308
 			 ->s('date', gmdate($this->dateHeader))
309 309
 			 ->s('digest', $signedRequest->getDigest())
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 		foreach ($data->keys() as $element) {
323 323
 			try {
324 324
 				$value = $data->gItem($element);
325
-				$signing[] = $element . ': ' . $value;
325
+				$signing[] = $element.': '.$value;
326 326
 				if ($element !== '(request-target)') {
327 327
 					$signedRequest->getOutgoingRequest()->addHeader($element, $value);
328 328
 				}
@@ -355,10 +355,10 @@  discard block
 block discarded – undo
355 355
 		$headers = array_diff($signedRequest->getSignatureHeader()->keys(), ['(request-target)']);
356 356
 		$signatory = $signedRequest->getSignatory();
357 357
 		$signatureElements = [
358
-			'keyId="' . $signatory->getKeyId() . '"',
359
-			'algorithm="' . $this->getChosenEncryption($signatory) . '"',
360
-			'headers="' . implode(' ', $headers) . '"',
361
-			'signature="' . $signedRequest->getSignedSignature() . '"'
358
+			'keyId="'.$signatory->getKeyId().'"',
359
+			'algorithm="'.$this->getChosenEncryption($signatory).'"',
360
+			'headers="'.implode(' ', $headers).'"',
361
+			'signature="'.$signedRequest->getSignedSignature().'"'
362 362
 		];
363 363
 
364 364
 		$signedRequest->getOutgoingRequest()->addHeader('Signature', implode(',', $signatureElements));
Please login to merge, or discard this patch.