Completed
Pull Request — master (#6260)
by Jan-Christoph
19:38
created
apps/dav/lib/Connector/Sabre/ChecksumList.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
 	function xmlSerialize(Writer $writer) {
67 67
 
68 68
 		foreach ($this->checksums as $checksum) {
69
-			$writer->writeElement('{' . self::NS_OWNCLOUD . '}checksum', $checksum);
69
+			$writer->writeElement('{'.self::NS_OWNCLOUD.'}checksum', $checksum);
70 70
 		}
71 71
 	}
72 72
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public function beforeHandler(RequestInterface $request) {
66 66
 		$userAgent = $request->getHeader('User-Agent');
67
-		if($userAgent === null) {
67
+		if ($userAgent === null) {
68 68
 			return;
69 69
 		}
70 70
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 		// Match on the mirall version which is in scheme "Mozilla/5.0 (%1) mirall/%2" or
74 74
 		// "mirall/%1" for older releases
75 75
 		preg_match("/(?:mirall\\/)([\d.]+)/i", $userAgent, $versionMatches);
76
-		if(isset($versionMatches[1]) &&
76
+		if (isset($versionMatches[1]) &&
77 77
 			version_compare($versionMatches[1], $minimumSupportedDesktopVersion) === -1) {
78 78
 			throw new \Sabre\DAV\Exception\Forbidden('Unsupported client version.');
79 79
 		}
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
 	 * @return mixed|string
100 100
 	 */
101 101
 	public function getCommentsLink(Node $node) {
102
-		$href =  $this->server->getBaseUri();
102
+		$href = $this->server->getBaseUri();
103 103
 		$entryPoint = strpos($href, '/remote.php/');
104
-		if($entryPoint === false) {
104
+		if ($entryPoint === false) {
105 105
 			// in case we end up somewhere else, unexpectedly.
106 106
 			return null;
107 107
 		}
108
-		$commentsPart = 'dav/comments/files/' . rawurldecode($node->getId());
108
+		$commentsPart = 'dav/comments/files/'.rawurldecode($node->getId());
109 109
 		$href = substr_replace($href, $commentsPart, $entryPoint + strlen('/remote.php/'));
110 110
 		return $href;
111 111
 	}
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function getUnreadCount(Node $node) {
121 121
 		$user = $this->userSession->getUser();
122
-		if(is_null($user)) {
122
+		if (is_null($user)) {
123 123
 			return null;
124 124
 		}
125 125
 
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/ShareTypeList.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 			return null;
72 72
 		}
73 73
 		foreach ($tree as $elem) {
74
-			if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}share-type') {
75
-				$shareTypes[] = (int)$elem['value'];
74
+			if ($elem['name'] === '{'.self::NS_OWNCLOUD.'}share-type') {
75
+				$shareTypes[] = (int) $elem['value'];
76 76
 			}
77 77
 		}
78 78
 		return new self($shareTypes);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	function xmlSerialize(Writer $writer) {
88 88
 		foreach ($this->shareTypes as $shareType) {
89
-			$writer->writeElement('{' . self::NS_OWNCLOUD . '}share-type', $shareType);
89
+			$writer->writeElement('{'.self::NS_OWNCLOUD.'}share-type', $shareType);
90 90
 		}
91 91
 	}
92 92
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/Forbidden.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,17 +49,17 @@
 block discarded – undo
49 49
 	 * @param \DOMElement $errorNode
50 50
 	 * @return void
51 51
 	 */
52
-	public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) {
52
+	public function serialize(\Sabre\DAV\Server $server, \DOMElement $errorNode) {
53 53
 
54 54
 		// set ownCloud namespace
55 55
 		$errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
56 56
 
57 57
 		// adding the retry node
58
-		$error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true));
58
+		$error = $errorNode->ownerDocument->createElementNS('o:', 'o:retry', var_export($this->retry, true));
59 59
 		$errorNode->appendChild($error);
60 60
 
61 61
 		// adding the message node
62
-		$error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage());
62
+		$error = $errorNode->ownerDocument->createElementNS('o:', 'o:reason', $this->getMessage());
63 63
 		$errorNode->appendChild($error);
64 64
 	}
65 65
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,17 +61,17 @@
 block discarded – undo
61 61
 	 * @param \DOMElement $errorNode
62 62
 	 * @return void
63 63
 	 */
64
-	public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) {
64
+	public function serialize(\Sabre\DAV\Server $server, \DOMElement $errorNode) {
65 65
 
66 66
 		// set ownCloud namespace
67 67
 		$errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
68 68
 
69 69
 		// adding the retry node
70
-		$error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true));
70
+		$error = $errorNode->ownerDocument->createElementNS('o:', 'o:retry', var_export($this->retry, true));
71 71
 		$errorNode->appendChild($error);
72 72
 
73 73
 		// adding the message node
74
-		$error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage());
74
+		$error = $errorNode->ownerDocument->createElementNS('o:', 'o:reason', $this->getMessage());
75 75
 		$errorNode->appendChild($error);
76 76
 	}
77 77
 
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/FileLocked.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 class FileLocked extends \Sabre\DAV\Exception {
32 32
 
33 33
 	public function __construct($message = "", $code = 0, Exception $previous = null) {
34
-		if($previous instanceof \OCP\Files\LockNotAcquiredException) {
34
+		if ($previous instanceof \OCP\Files\LockNotAcquiredException) {
35 35
 			$message = sprintf('Target file %s is locked by another process.', $previous->path);
36 36
 		}
37 37
 		parent::__construct($message, $code, $previous);
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/ServerFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		$server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin());
118 118
 		// Some WebDAV clients do require Class 2 WebDAV support (locking), since
119 119
 		// we do not provide locking we emulate it using a fake locking plugin.
120
-		if($this->request->isUserAgent([
120
+		if ($this->request->isUserAgent([
121 121
 				'/WebDAVFS/',
122 122
 				'/Microsoft Office OneNote 2013/',
123 123
 				'/Microsoft-WebDAV-MiniRedir/',
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		}
131 131
 
132 132
 		// wait with registering these until auth is handled and the filesystem is setup
133
-		$server->on('beforeMethod', function () use ($server, $objectTree, $viewCallBack) {
133
+		$server->on('beforeMethod', function() use ($server, $objectTree, $viewCallBack) {
134 134
 			// ensure the skeleton is copied
135 135
 			$userFolder = \OC::$server->getUserFolder();
136 136
 			
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 			);
163 163
 			$server->addPlugin(new \OCA\DAV\Connector\Sabre\QuotaPlugin($view));
164 164
 
165
-			if($this->userSession->isLoggedIn()) {
165
+			if ($this->userSession->isLoggedIn()) {
166 166
 				$server->addPlugin(new \OCA\DAV\Connector\Sabre\TagsPlugin($objectTree, $this->tagManager));
167 167
 				$server->addPlugin(new \OCA\DAV\Connector\Sabre\SharesPlugin(
168 168
 					$objectTree,
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/CustomPropertiesBackend.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			// we catch the exception to prevent breaking the whole list with a 404
112 112
 			// (soft fail)
113 113
 			\OC::$server->getLogger()->warning(
114
-				'Could not get node for path: \"' . $path . '\" : ' . $e->getMessage(),
114
+				'Could not get node for path: \"'.$path.'\" : '.$e->getMessage(),
115 115
 				array('app' => 'files')
116 116
 			);
117 117
 			return;
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		$statement = $this->connection->prepare(
171 171
 			'DELETE FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?'
172 172
 		);
173
-		$statement->execute(array($this->user, '/' . $path));
173
+		$statement->execute(array($this->user, '/'.$path));
174 174
 		$statement->closeCursor();
175 175
 
176 176
 		unset($this->cache[$path]);
@@ -186,10 +186,10 @@  discard block
 block discarded – undo
186 186
 	 */
187 187
 	public function move($source, $destination) {
188 188
 		$statement = $this->connection->prepare(
189
-			'UPDATE `*PREFIX*properties` SET `propertypath` = ?' .
189
+			'UPDATE `*PREFIX*properties` SET `propertypath` = ?'.
190 190
 			' WHERE `userid` = ? AND `propertypath` = ?'
191 191
 		);
192
-		$statement->execute(array('/' . $destination, $this->user, '/' . $source));
192
+		$statement->execute(array('/'.$destination, $this->user, '/'.$source));
193 193
 		$statement->closeCursor();
194 194
 	}
195 195
 
@@ -250,13 +250,13 @@  discard block
 block discarded – undo
250 250
 	private function updateProperties($node, $properties) {
251 251
 		$path = $node->getPath();
252 252
 
253
-		$deleteStatement = 'DELETE FROM `*PREFIX*properties`' .
253
+		$deleteStatement = 'DELETE FROM `*PREFIX*properties`'.
254 254
 			' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?';
255 255
 
256
-		$insertStatement = 'INSERT INTO `*PREFIX*properties`' .
256
+		$insertStatement = 'INSERT INTO `*PREFIX*properties`'.
257 257
 			' (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)';
258 258
 
259
-		$updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?' .
259
+		$updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?'.
260 260
 			' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?';
261 261
 
262 262
 		// TODO: use "insert or update" strategy ?
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
 		$result = $this->connection->executeQuery(
331 331
 			$sql,
332
-			array($this->user, $this->connection->escapeLikeParameter(rtrim($path, '/')) . '/%', $requestedProperties),
332
+			array($this->user, $this->connection->escapeLikeParameter(rtrim($path, '/')).'/%', $requestedProperties),
333 333
 			array(null, null, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY)
334 334
 		);
335 335
 
Please login to merge, or discard this patch.