Completed
Pull Request — master (#8946)
by Robin
78:30 queued 60:11
created
lib/private/Log.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 /**
4 4
  * @copyright Copyright (c) 2016, ownCloud, Inc.
5 5
  *
@@ -121,14 +121,14 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function __construct($logger = null, SystemConfig $config = null, $normalizer = null, IRegistry $registry = null) {
123 123
 		// FIXME: Add this for backwards compatibility, should be fixed at some point probably
124
-		if($config === null) {
124
+		if ($config === null) {
125 125
 			$config = \OC::$server->getSystemConfig();
126 126
 		}
127 127
 
128 128
 		$this->config = $config;
129 129
 
130 130
 		// FIXME: Add this for backwards compatibility, should be fixed at some point probably
131
-		if($logger === null) {
131
+		if ($logger === null) {
132 132
 			$logType = $this->config->getValue('log_type', 'file');
133 133
 			$this->logger = static::getLogClass($logType);
134 134
 			call_user_func([$this->logger, 'init']);
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 		// interpolate $message as defined in PSR-3
262 262
 		$replace = [];
263 263
 		foreach ($context as $key => $val) {
264
-			$replace['{' . $key . '}'] = $val;
264
+			$replace['{'.$key.'}'] = $val;
265 265
 		}
266 266
 		$message = strtr($message, $replace);
267 267
 
@@ -275,27 +275,27 @@  discard block
 block discarded – undo
275 275
 		 * check for a special log condition - this enables an increased log on
276 276
 		 * a per request/user base
277 277
 		 */
278
-		if($this->logConditionSatisfied === null) {
278
+		if ($this->logConditionSatisfied === null) {
279 279
 			// default to false to just process this once per request
280 280
 			$this->logConditionSatisfied = false;
281
-			if(!empty($logCondition)) {
281
+			if (!empty($logCondition)) {
282 282
 
283 283
 				// check for secret token in the request
284
-				if(isset($logCondition['shared_secret'])) {
284
+				if (isset($logCondition['shared_secret'])) {
285 285
 					$request = \OC::$server->getRequest();
286 286
 
287 287
 					// if token is found in the request change set the log condition to satisfied
288
-					if($request && hash_equals($logCondition['shared_secret'], $request->getParam('log_secret', ''))) {
288
+					if ($request && hash_equals($logCondition['shared_secret'], $request->getParam('log_secret', ''))) {
289 289
 						$this->logConditionSatisfied = true;
290 290
 					}
291 291
 				}
292 292
 
293 293
 				// check for user
294
-				if(isset($logCondition['users'])) {
294
+				if (isset($logCondition['users'])) {
295 295
 					$user = \OC::$server->getUserSession()->getUser();
296 296
 
297 297
 					// if the user matches set the log condition to satisfied
298
-					if($user !== null && in_array($user->getUID(), $logCondition['users'], true)) {
298
+					if ($user !== null && in_array($user->getUID(), $logCondition['users'], true)) {
299 299
 						$this->logConditionSatisfied = true;
300 300
 					}
301 301
 				}
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 		}
304 304
 
305 305
 		// if log condition is satisfied change the required log level to DEBUG
306
-		if($this->logConditionSatisfied) {
306
+		if ($this->logConditionSatisfied) {
307 307
 			return Util::DEBUG;
308 308
 		}
309 309
 
Please login to merge, or discard this patch.