Completed
Push — master ( 92e282...5f81a7 )
by John
25:44 queued 14s
created
lib/public/Log/IWriter.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@
 block discarded – undo
28 28
  * @since 14.0.0
29 29
  */
30 30
 interface IWriter {
31
-	/**
32
-	 * @since 14.0.0
33
-	 *
34
-	 * @param string $app
35
-	 * @param string|array $message
36
-	 * @param int $level
37
-	 */
38
-	public function write(string $app, $message, int $level);
31
+    /**
32
+     * @since 14.0.0
33
+     *
34
+     * @param string $app
35
+     * @param string|array $message
36
+     * @param int $level
37
+     */
38
+    public function write(string $app, $message, int $level);
39 39
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/ChecksumList.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -32,37 +32,37 @@
 block discarded – undo
32 32
  * checksum name.
33 33
  */
34 34
 class ChecksumList implements XmlSerializable {
35
-	public const NS_OWNCLOUD = 'http://owncloud.org/ns';
35
+    public const NS_OWNCLOUD = 'http://owncloud.org/ns';
36 36
 
37
-	/** @var string[] of TYPE:CHECKSUM */
38
-	private array $checksums;
37
+    /** @var string[] of TYPE:CHECKSUM */
38
+    private array $checksums;
39 39
 
40
-	public function __construct(string $checksum) {
41
-		$this->checksums = explode(' ', $checksum);
42
-	}
40
+    public function __construct(string $checksum) {
41
+        $this->checksums = explode(' ', $checksum);
42
+    }
43 43
 
44
-	/**
45
-	 * The xmlSerialize method is called during xml writing.
46
-	 *
47
-	 * Use the $writer argument to write its own xml serialization.
48
-	 *
49
-	 * An important note: do _not_ create a parent element. Any element
50
-	 * implementing XmlSerializble should only ever write what's considered
51
-	 * its 'inner xml'.
52
-	 *
53
-	 * The parent of the current element is responsible for writing a
54
-	 * containing element.
55
-	 *
56
-	 * This allows serializers to be re-used for different element names.
57
-	 *
58
-	 * If you are opening new elements, you must also close them again.
59
-	 *
60
-	 * @param Writer $writer
61
-	 * @return void
62
-	 */
63
-	public function xmlSerialize(Writer $writer) {
64
-		foreach ($this->checksums as $checksum) {
65
-			$writer->writeElement('{' . self::NS_OWNCLOUD . '}checksum', $checksum);
66
-		}
67
-	}
44
+    /**
45
+     * The xmlSerialize method is called during xml writing.
46
+     *
47
+     * Use the $writer argument to write its own xml serialization.
48
+     *
49
+     * An important note: do _not_ create a parent element. Any element
50
+     * implementing XmlSerializble should only ever write what's considered
51
+     * its 'inner xml'.
52
+     *
53
+     * The parent of the current element is responsible for writing a
54
+     * containing element.
55
+     *
56
+     * This allows serializers to be re-used for different element names.
57
+     *
58
+     * If you are opening new elements, you must also close them again.
59
+     *
60
+     * @param Writer $writer
61
+     * @return void
62
+     */
63
+    public function xmlSerialize(Writer $writer) {
64
+        foreach ($this->checksums as $checksum) {
65
+            $writer->writeElement('{' . self::NS_OWNCLOUD . '}checksum', $checksum);
66
+        }
67
+    }
68 68
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/DAV.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -30,24 +30,24 @@
 block discarded – undo
30 30
 use OCP\IL10N;
31 31
 
32 32
 class DAV extends Backend {
33
-	use LegacyDependencyCheckPolyfill;
33
+    use LegacyDependencyCheckPolyfill;
34 34
 
35
-	public function __construct(IL10N $l, Password $legacyAuth) {
36
-		$this
37
-			->setIdentifier('dav')
38
-			->addIdentifierAlias('\OC\Files\Storage\DAV') // legacy compat
39
-			->setStorageClass('\OC\Files\Storage\DAV')
40
-			->setText($l->t('WebDAV'))
41
-			->addParameters([
42
-				new DefinitionParameter('host', $l->t('URL')),
43
-				(new DefinitionParameter('root', $l->t('Remote subfolder')))
44
-					->setFlag(DefinitionParameter::FLAG_OPTIONAL),
45
-				(new DefinitionParameter('secure', $l->t('Secure https://')))
46
-					->setType(DefinitionParameter::VALUE_BOOLEAN)
47
-					->setDefaultValue(true),
48
-			])
49
-			->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
50
-			->setLegacyAuthMechanism($legacyAuth)
51
-		;
52
-	}
35
+    public function __construct(IL10N $l, Password $legacyAuth) {
36
+        $this
37
+            ->setIdentifier('dav')
38
+            ->addIdentifierAlias('\OC\Files\Storage\DAV') // legacy compat
39
+            ->setStorageClass('\OC\Files\Storage\DAV')
40
+            ->setText($l->t('WebDAV'))
41
+            ->addParameters([
42
+                new DefinitionParameter('host', $l->t('URL')),
43
+                (new DefinitionParameter('root', $l->t('Remote subfolder')))
44
+                    ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
45
+                (new DefinitionParameter('secure', $l->t('Secure https://')))
46
+                    ->setType(DefinitionParameter::VALUE_BOOLEAN)
47
+                    ->setDefaultValue(true),
48
+            ])
49
+            ->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
50
+            ->setLegacyAuthMechanism($legacyAuth)
51
+        ;
52
+    }
53 53
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/OwnCloud.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -30,22 +30,22 @@
 block discarded – undo
30 30
 use OCP\IL10N;
31 31
 
32 32
 class OwnCloud extends Backend {
33
-	public function __construct(IL10N $l, Password $legacyAuth) {
34
-		$this
35
-			->setIdentifier('owncloud')
36
-			->addIdentifierAlias('\OC\Files\Storage\OwnCloud') // legacy compat
37
-			->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud')
38
-			->setText($l->t('Nextcloud'))
39
-			->addParameters([
40
-				new DefinitionParameter('host', $l->t('URL')),
41
-				(new DefinitionParameter('root', $l->t('Remote subfolder')))
42
-					->setFlag(DefinitionParameter::FLAG_OPTIONAL),
43
-				(new DefinitionParameter('secure', $l->t('Secure https://')))
44
-					->setType(DefinitionParameter::VALUE_BOOLEAN)
45
-					->setDefaultValue(true),
46
-			])
47
-			->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
48
-			->setLegacyAuthMechanism($legacyAuth)
49
-		;
50
-	}
33
+    public function __construct(IL10N $l, Password $legacyAuth) {
34
+        $this
35
+            ->setIdentifier('owncloud')
36
+            ->addIdentifierAlias('\OC\Files\Storage\OwnCloud') // legacy compat
37
+            ->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud')
38
+            ->setText($l->t('Nextcloud'))
39
+            ->addParameters([
40
+                new DefinitionParameter('host', $l->t('URL')),
41
+                (new DefinitionParameter('root', $l->t('Remote subfolder')))
42
+                    ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
43
+                (new DefinitionParameter('secure', $l->t('Secure https://')))
44
+                    ->setType(DefinitionParameter::VALUE_BOOLEAN)
45
+                    ->setDefaultValue(true),
46
+            ])
47
+            ->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
48
+            ->setLegacyAuthMechanism($legacyAuth)
49
+        ;
50
+    }
51 51
 }
Please login to merge, or discard this patch.
lib/private/KnownUser/KnownUser.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@
 block discarded – undo
34 34
  * @method string getKnownUser()
35 35
  */
36 36
 class KnownUser extends Entity {
37
-	/** @var string */
38
-	protected $knownTo;
37
+    /** @var string */
38
+    protected $knownTo;
39 39
 
40
-	/** @var string */
41
-	protected $knownUser;
40
+    /** @var string */
41
+    protected $knownUser;
42 42
 
43
-	public function __construct() {
44
-		$this->addType('knownTo', 'string');
45
-		$this->addType('knownUser', 'string');
46
-	}
43
+    public function __construct() {
44
+        $this->addType('knownTo', 'string');
45
+        $this->addType('knownUser', 'string');
46
+    }
47 47
 }
Please login to merge, or discard this patch.
lib/private/AppFramework/Middleware/OCSMiddleware.php 1 patch
Indentation   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -39,123 +39,123 @@
 block discarded – undo
39 39
 use OCP\IRequest;
40 40
 
41 41
 class OCSMiddleware extends Middleware {
42
-	/** @var IRequest */
43
-	private $request;
44
-
45
-	/** @var int */
46
-	private $ocsVersion;
47
-
48
-	/**
49
-	 * @param IRequest $request
50
-	 */
51
-	public function __construct(IRequest $request) {
52
-		$this->request = $request;
53
-	}
54
-
55
-	/**
56
-	 * @param Controller $controller
57
-	 * @param string $methodName
58
-	 */
59
-	public function beforeController($controller, $methodName) {
60
-		if ($controller instanceof OCSController) {
61
-			if (substr_compare($this->request->getScriptName(), '/ocs/v2.php', -strlen('/ocs/v2.php')) === 0) {
62
-				$this->ocsVersion = 2;
63
-			} else {
64
-				$this->ocsVersion = 1;
65
-			}
66
-			$controller->setOCSVersion($this->ocsVersion);
67
-		}
68
-	}
69
-
70
-	/**
71
-	 * @param Controller $controller
72
-	 * @param string $methodName
73
-	 * @param \Exception $exception
74
-	 * @throws \Exception
75
-	 * @return BaseResponse
76
-	 */
77
-	public function afterException($controller, $methodName, \Exception $exception) {
78
-		if ($controller instanceof OCSController && $exception instanceof OCSException) {
79
-			$code = $exception->getCode();
80
-			if ($code === 0) {
81
-				$code = \OCP\AppFramework\OCSController::RESPOND_UNKNOWN_ERROR;
82
-			}
83
-
84
-			return $this->buildNewResponse($controller, $code, $exception->getMessage());
85
-		}
86
-
87
-		throw $exception;
88
-	}
89
-
90
-	/**
91
-	 * @param Controller $controller
92
-	 * @param string $methodName
93
-	 * @param Response $response
94
-	 * @return \OCP\AppFramework\Http\Response
95
-	 */
96
-	public function afterController($controller, $methodName, Response $response) {
97
-		/*
42
+    /** @var IRequest */
43
+    private $request;
44
+
45
+    /** @var int */
46
+    private $ocsVersion;
47
+
48
+    /**
49
+     * @param IRequest $request
50
+     */
51
+    public function __construct(IRequest $request) {
52
+        $this->request = $request;
53
+    }
54
+
55
+    /**
56
+     * @param Controller $controller
57
+     * @param string $methodName
58
+     */
59
+    public function beforeController($controller, $methodName) {
60
+        if ($controller instanceof OCSController) {
61
+            if (substr_compare($this->request->getScriptName(), '/ocs/v2.php', -strlen('/ocs/v2.php')) === 0) {
62
+                $this->ocsVersion = 2;
63
+            } else {
64
+                $this->ocsVersion = 1;
65
+            }
66
+            $controller->setOCSVersion($this->ocsVersion);
67
+        }
68
+    }
69
+
70
+    /**
71
+     * @param Controller $controller
72
+     * @param string $methodName
73
+     * @param \Exception $exception
74
+     * @throws \Exception
75
+     * @return BaseResponse
76
+     */
77
+    public function afterException($controller, $methodName, \Exception $exception) {
78
+        if ($controller instanceof OCSController && $exception instanceof OCSException) {
79
+            $code = $exception->getCode();
80
+            if ($code === 0) {
81
+                $code = \OCP\AppFramework\OCSController::RESPOND_UNKNOWN_ERROR;
82
+            }
83
+
84
+            return $this->buildNewResponse($controller, $code, $exception->getMessage());
85
+        }
86
+
87
+        throw $exception;
88
+    }
89
+
90
+    /**
91
+     * @param Controller $controller
92
+     * @param string $methodName
93
+     * @param Response $response
94
+     * @return \OCP\AppFramework\Http\Response
95
+     */
96
+    public function afterController($controller, $methodName, Response $response) {
97
+        /*
98 98
 		 * If a different middleware has detected that a request unauthorized or forbidden
99 99
 		 * we need to catch the response and convert it to a proper OCS response.
100 100
 		 */
101
-		if ($controller instanceof OCSController && !($response instanceof BaseResponse)) {
102
-			if ($response->getStatus() === Http::STATUS_UNAUTHORIZED) {
103
-				$message = '';
104
-				if ($response instanceof JSONResponse) {
105
-					/** @var DataResponse $response */
106
-					$message = $response->getData()['message'];
107
-				}
108
-
109
-				return $this->buildNewResponse($controller, OCSController::RESPOND_UNAUTHORISED, $message);
110
-			}
111
-			if ($response->getStatus() === Http::STATUS_FORBIDDEN) {
112
-				$message = '';
113
-				if ($response instanceof JSONResponse) {
114
-					/** @var DataResponse $response */
115
-					$message = $response->getData()['message'];
116
-				}
117
-
118
-				return $this->buildNewResponse($controller, Http::STATUS_FORBIDDEN, $message);
119
-			}
120
-		}
121
-
122
-		return $response;
123
-	}
124
-
125
-	/**
126
-	 * @param Controller $controller
127
-	 * @param int $code
128
-	 * @param string $message
129
-	 * @return V1Response|V2Response
130
-	 */
131
-	private function buildNewResponse(Controller $controller, $code, $message) {
132
-		$format = $this->getFormat($controller);
133
-
134
-		$data = new DataResponse();
135
-		$data->setStatus($code);
136
-		if ($this->ocsVersion === 1) {
137
-			$response = new V1Response($data, $format, $message);
138
-		} else {
139
-			$response = new V2Response($data, $format, $message);
140
-		}
141
-
142
-		return $response;
143
-	}
144
-
145
-	/**
146
-	 * @param Controller $controller
147
-	 * @return string
148
-	 */
149
-	private function getFormat(Controller $controller) {
150
-		// get format from the url format or request format parameter
151
-		$format = $this->request->getParam('format');
152
-
153
-		// if none is given try the first Accept header
154
-		if ($format === null) {
155
-			$headers = $this->request->getHeader('Accept');
156
-			$format = $controller->getResponderByHTTPHeader($headers, 'xml');
157
-		}
158
-
159
-		return $format;
160
-	}
101
+        if ($controller instanceof OCSController && !($response instanceof BaseResponse)) {
102
+            if ($response->getStatus() === Http::STATUS_UNAUTHORIZED) {
103
+                $message = '';
104
+                if ($response instanceof JSONResponse) {
105
+                    /** @var DataResponse $response */
106
+                    $message = $response->getData()['message'];
107
+                }
108
+
109
+                return $this->buildNewResponse($controller, OCSController::RESPOND_UNAUTHORISED, $message);
110
+            }
111
+            if ($response->getStatus() === Http::STATUS_FORBIDDEN) {
112
+                $message = '';
113
+                if ($response instanceof JSONResponse) {
114
+                    /** @var DataResponse $response */
115
+                    $message = $response->getData()['message'];
116
+                }
117
+
118
+                return $this->buildNewResponse($controller, Http::STATUS_FORBIDDEN, $message);
119
+            }
120
+        }
121
+
122
+        return $response;
123
+    }
124
+
125
+    /**
126
+     * @param Controller $controller
127
+     * @param int $code
128
+     * @param string $message
129
+     * @return V1Response|V2Response
130
+     */
131
+    private function buildNewResponse(Controller $controller, $code, $message) {
132
+        $format = $this->getFormat($controller);
133
+
134
+        $data = new DataResponse();
135
+        $data->setStatus($code);
136
+        if ($this->ocsVersion === 1) {
137
+            $response = new V1Response($data, $format, $message);
138
+        } else {
139
+            $response = new V2Response($data, $format, $message);
140
+        }
141
+
142
+        return $response;
143
+    }
144
+
145
+    /**
146
+     * @param Controller $controller
147
+     * @return string
148
+     */
149
+    private function getFormat(Controller $controller) {
150
+        // get format from the url format or request format parameter
151
+        $format = $this->request->getParam('format');
152
+
153
+        // if none is given try the first Accept header
154
+        if ($format === null) {
155
+            $headers = $this->request->getHeader('Accept');
156
+            $format = $controller->getResponderByHTTPHeader($headers, 'xml');
157
+        }
158
+
159
+        return $format;
160
+    }
161 161
 }
Please login to merge, or discard this patch.
lib/private/AppFramework/Bootstrap/BootContext.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -31,22 +31,22 @@
 block discarded – undo
31 31
 use OCP\IServerContainer;
32 32
 
33 33
 class BootContext implements IBootContext {
34
-	/** @var IAppContainer */
35
-	private $appContainer;
34
+    /** @var IAppContainer */
35
+    private $appContainer;
36 36
 
37
-	public function __construct(IAppContainer $appContainer) {
38
-		$this->appContainer = $appContainer;
39
-	}
37
+    public function __construct(IAppContainer $appContainer) {
38
+        $this->appContainer = $appContainer;
39
+    }
40 40
 
41
-	public function getAppContainer(): IAppContainer {
42
-		return $this->appContainer;
43
-	}
41
+    public function getAppContainer(): IAppContainer {
42
+        return $this->appContainer;
43
+    }
44 44
 
45
-	public function getServerContainer(): IServerContainer {
46
-		return $this->appContainer->get(IServerContainer::class);
47
-	}
45
+    public function getServerContainer(): IServerContainer {
46
+        return $this->appContainer->get(IServerContainer::class);
47
+    }
48 48
 
49
-	public function injectFn(callable $fn) {
50
-		return (new FunctionInjector($this->appContainer))->injectFn($fn);
51
-	}
49
+    public function injectFn(callable $fn) {
50
+        return (new FunctionInjector($this->appContainer))->injectFn($fn);
51
+    }
52 52
 }
Please login to merge, or discard this patch.
lib/private/AppFramework/Bootstrap/ARegistration.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,17 +29,17 @@
 block discarded – undo
29 29
  * @psalm-immutable
30 30
  */
31 31
 abstract class ARegistration {
32
-	/** @var string */
33
-	private $appId;
32
+    /** @var string */
33
+    private $appId;
34 34
 
35
-	public function __construct(string $appId) {
36
-		$this->appId = $appId;
37
-	}
35
+    public function __construct(string $appId) {
36
+        $this->appId = $appId;
37
+    }
38 38
 
39
-	/**
40
-	 * @return string
41
-	 */
42
-	public function getAppId(): string {
43
-		return $this->appId;
44
-	}
39
+    /**
40
+     * @return string
41
+     */
42
+    public function getAppId(): string {
43
+        return $this->appId;
44
+    }
45 45
 }
Please login to merge, or discard this patch.
lib/private/AppFramework/Bootstrap/FunctionInjector.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -33,36 +33,36 @@
 block discarded – undo
33 33
 use function array_map;
34 34
 
35 35
 class FunctionInjector {
36
-	/** @var ContainerInterface */
37
-	private $container;
36
+    /** @var ContainerInterface */
37
+    private $container;
38 38
 
39
-	public function __construct(ContainerInterface $container) {
40
-		$this->container = $container;
41
-	}
39
+    public function __construct(ContainerInterface $container) {
40
+        $this->container = $container;
41
+    }
42 42
 
43
-	public function injectFn(callable $fn) {
44
-		$reflected = new ReflectionFunction(Closure::fromCallable($fn));
45
-		return $fn(...array_map(function (ReflectionParameter $param) {
46
-			// First we try by type (more likely these days)
47
-			if (($type = $param->getType()) !== null) {
48
-				try {
49
-					return $this->container->get($type->getName());
50
-				} catch (QueryException $ex) {
51
-					// Ignore and try name as well
52
-				}
53
-			}
54
-			// Second we try by name (mostly for primitives)
55
-			try {
56
-				return $this->container->get($param->getName());
57
-			} catch (QueryException $ex) {
58
-				// As a last resort we pass `null` if allowed
59
-				if ($type !== null && $type->allowsNull()) {
60
-					return null;
61
-				}
43
+    public function injectFn(callable $fn) {
44
+        $reflected = new ReflectionFunction(Closure::fromCallable($fn));
45
+        return $fn(...array_map(function (ReflectionParameter $param) {
46
+            // First we try by type (more likely these days)
47
+            if (($type = $param->getType()) !== null) {
48
+                try {
49
+                    return $this->container->get($type->getName());
50
+                } catch (QueryException $ex) {
51
+                    // Ignore and try name as well
52
+                }
53
+            }
54
+            // Second we try by name (mostly for primitives)
55
+            try {
56
+                return $this->container->get($param->getName());
57
+            } catch (QueryException $ex) {
58
+                // As a last resort we pass `null` if allowed
59
+                if ($type !== null && $type->allowsNull()) {
60
+                    return null;
61
+                }
62 62
 
63
-				// Nothing worked, time to bail out
64
-				throw $ex;
65
-			}
66
-		}, $reflected->getParameters()));
67
-	}
63
+                // Nothing worked, time to bail out
64
+                throw $ex;
65
+            }
66
+        }, $reflected->getParameters()));
67
+    }
68 68
 }
Please login to merge, or discard this patch.