Passed
Push — master ( c00d6f...a085a8 )
by Morris
09:54 queued 11s
created
apps/dav/lib/Connector/Sabre/LockPlugin.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -34,53 +34,53 @@
 block discarded – undo
34 34
 use Sabre\HTTP\RequestInterface;
35 35
 
36 36
 class LockPlugin extends ServerPlugin {
37
-	/**
38
-	 * Reference to main server object
39
-	 *
40
-	 * @var \Sabre\DAV\Server
41
-	 */
42
-	private $server;
37
+    /**
38
+     * Reference to main server object
39
+     *
40
+     * @var \Sabre\DAV\Server
41
+     */
42
+    private $server;
43 43
 
44
-	/**
45
-	 * {@inheritdoc}
46
-	 */
47
-	public function initialize(\Sabre\DAV\Server $server) {
48
-		$this->server = $server;
49
-		$this->server->on('beforeMethod', [$this, 'getLock'], 50);
50
-		$this->server->on('afterMethod', [$this, 'releaseLock'], 50);
51
-	}
44
+    /**
45
+     * {@inheritdoc}
46
+     */
47
+    public function initialize(\Sabre\DAV\Server $server) {
48
+        $this->server = $server;
49
+        $this->server->on('beforeMethod', [$this, 'getLock'], 50);
50
+        $this->server->on('afterMethod', [$this, 'releaseLock'], 50);
51
+    }
52 52
 
53
-	public function getLock(RequestInterface $request) {
54
-		// we can't listen on 'beforeMethod:PUT' due to order of operations with setting up the tree
55
-		// so instead we limit ourselves to the PUT method manually
56
-		if ($request->getMethod() !== 'PUT' || isset($_SERVER['HTTP_OC_CHUNKED'])) {
57
-			return;
58
-		}
59
-		try {
60
-			$node = $this->server->tree->getNodeForPath($request->getPath());
61
-		} catch (NotFound $e) {
62
-			return;
63
-		}
64
-		if ($node instanceof Node) {
65
-			try {
66
-				$node->acquireLock(ILockingProvider::LOCK_SHARED);
67
-			} catch (LockedException $e) {
68
-				throw new FileLocked($e->getMessage(), $e->getCode(), $e);
69
-			}
70
-		}
71
-	}
53
+    public function getLock(RequestInterface $request) {
54
+        // we can't listen on 'beforeMethod:PUT' due to order of operations with setting up the tree
55
+        // so instead we limit ourselves to the PUT method manually
56
+        if ($request->getMethod() !== 'PUT' || isset($_SERVER['HTTP_OC_CHUNKED'])) {
57
+            return;
58
+        }
59
+        try {
60
+            $node = $this->server->tree->getNodeForPath($request->getPath());
61
+        } catch (NotFound $e) {
62
+            return;
63
+        }
64
+        if ($node instanceof Node) {
65
+            try {
66
+                $node->acquireLock(ILockingProvider::LOCK_SHARED);
67
+            } catch (LockedException $e) {
68
+                throw new FileLocked($e->getMessage(), $e->getCode(), $e);
69
+            }
70
+        }
71
+    }
72 72
 
73
-	public function releaseLock(RequestInterface $request) {
74
-		if ($request->getMethod() !== 'PUT' || isset($_SERVER['HTTP_OC_CHUNKED'])) {
75
-			return;
76
-		}
77
-		try {
78
-			$node = $this->server->tree->getNodeForPath($request->getPath());
79
-		} catch (NotFound $e) {
80
-			return;
81
-		}
82
-		if ($node instanceof Node) {
83
-			$node->releaseLock(ILockingProvider::LOCK_SHARED);
84
-		}
85
-	}
73
+    public function releaseLock(RequestInterface $request) {
74
+        if ($request->getMethod() !== 'PUT' || isset($_SERVER['HTTP_OC_CHUNKED'])) {
75
+            return;
76
+        }
77
+        try {
78
+            $node = $this->server->tree->getNodeForPath($request->getPath());
79
+        } catch (NotFound $e) {
80
+            return;
81
+        }
82
+        if ($node instanceof Node) {
83
+            $node->releaseLock(ILockingProvider::LOCK_SHARED);
84
+        }
85
+    }
86 86
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/Forbidden.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -24,42 +24,42 @@
 block discarded – undo
24 24
 
25 25
 class Forbidden extends \Sabre\DAV\Exception\Forbidden {
26 26
 
27
-	const NS_OWNCLOUD = 'http://owncloud.org/ns';
27
+    const NS_OWNCLOUD = 'http://owncloud.org/ns';
28 28
 
29
-	/**
30
-	 * @var bool
31
-	 */
32
-	private $retry;
29
+    /**
30
+     * @var bool
31
+     */
32
+    private $retry;
33 33
 
34
-	/**
35
-	 * @param string $message
36
-	 * @param bool $retry
37
-	 * @param \Exception $previous
38
-	 */
39
-	public function __construct($message, $retry = false, \Exception $previous = null) {
40
-		parent::__construct($message, 0, $previous);
41
-		$this->retry = $retry;
42
-	}
34
+    /**
35
+     * @param string $message
36
+     * @param bool $retry
37
+     * @param \Exception $previous
38
+     */
39
+    public function __construct($message, $retry = false, \Exception $previous = null) {
40
+        parent::__construct($message, 0, $previous);
41
+        $this->retry = $retry;
42
+    }
43 43
 
44
-	/**
45
-	 * This method allows the exception to include additional information
46
-	 * into the WebDAV error response
47
-	 *
48
-	 * @param \Sabre\DAV\Server $server
49
-	 * @param \DOMElement $errorNode
50
-	 * @return void
51
-	 */
52
-	public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) {
44
+    /**
45
+     * This method allows the exception to include additional information
46
+     * into the WebDAV error response
47
+     *
48
+     * @param \Sabre\DAV\Server $server
49
+     * @param \DOMElement $errorNode
50
+     * @return void
51
+     */
52
+    public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) {
53 53
 
54
-		// set ownCloud namespace
55
-		$errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
54
+        // set ownCloud namespace
55
+        $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
56 56
 
57
-		// adding the retry node
58
-		$error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true));
59
-		$errorNode->appendChild($error);
57
+        // adding the retry node
58
+        $error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true));
59
+        $errorNode->appendChild($error);
60 60
 
61
-		// adding the message node
62
-		$error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage());
63
-		$errorNode->appendChild($error);
64
-	}
61
+        // adding the message node
62
+        $error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage());
63
+        $errorNode->appendChild($error);
64
+    }
65 65
 }
Please login to merge, or discard this 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 2 patches
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.
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -26,54 +26,54 @@
 block discarded – undo
26 26
 
27 27
 class InvalidPath extends Exception {
28 28
 
29
-	const NS_OWNCLOUD = 'http://owncloud.org/ns';
29
+    const NS_OWNCLOUD = 'http://owncloud.org/ns';
30 30
 
31
-	/**
32
-	 * @var bool
33
-	 */
34
-	private $retry;
31
+    /**
32
+     * @var bool
33
+     */
34
+    private $retry;
35 35
 
36
-	/**
37
-	 * @param string $message
38
-	 * @param bool $retry
39
-	 * @param \Exception|null $previous
40
-	 */
41
-	public function __construct($message, $retry = false, \Exception $previous = null) {
42
-		parent::__construct($message, 0, $previous);
43
-		$this->retry = $retry;
44
-	}
36
+    /**
37
+     * @param string $message
38
+     * @param bool $retry
39
+     * @param \Exception|null $previous
40
+     */
41
+    public function __construct($message, $retry = false, \Exception $previous = null) {
42
+        parent::__construct($message, 0, $previous);
43
+        $this->retry = $retry;
44
+    }
45 45
 
46
-	/**
47
-	 * Returns the HTTP status code for this exception
48
-	 *
49
-	 * @return int
50
-	 */
51
-	public function getHTTPCode() {
46
+    /**
47
+     * Returns the HTTP status code for this exception
48
+     *
49
+     * @return int
50
+     */
51
+    public function getHTTPCode() {
52 52
 
53
-		return 400;
53
+        return 400;
54 54
 
55
-	}
55
+    }
56 56
 
57
-	/**
58
-	 * This method allows the exception to include additional information
59
-	 * into the WebDAV error response
60
-	 *
61
-	 * @param \Sabre\DAV\Server $server
62
-	 * @param \DOMElement $errorNode
63
-	 * @return void
64
-	 */
65
-	public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) {
57
+    /**
58
+     * This method allows the exception to include additional information
59
+     * into the WebDAV error response
60
+     *
61
+     * @param \Sabre\DAV\Server $server
62
+     * @param \DOMElement $errorNode
63
+     * @return void
64
+     */
65
+    public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) {
66 66
 
67
-		// set ownCloud namespace
68
-		$errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
67
+        // set ownCloud namespace
68
+        $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
69 69
 
70
-		// adding the retry node
71
-		$error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true));
72
-		$errorNode->appendChild($error);
70
+        // adding the retry node
71
+        $error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true));
72
+        $errorNode->appendChild($error);
73 73
 
74
-		// adding the message node
75
-		$error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage());
76
-		$errorNode->appendChild($error);
77
-	}
74
+        // adding the message node
75
+        $error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage());
76
+        $errorNode->appendChild($error);
77
+    }
78 78
 
79 79
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/PasswordLoginForbidden.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -29,27 +29,27 @@
 block discarded – undo
29 29
 
30 30
 class PasswordLoginForbidden extends NotAuthenticated {
31 31
 
32
-	const NS_OWNCLOUD = 'http://owncloud.org/ns';
33
-
34
-	public function getHTTPCode() {
35
-		return 401;
36
-	}
37
-
38
-	/**
39
-	 * This method allows the exception to include additional information
40
-	 * into the WebDAV error response
41
-	 *
42
-	 * @param Server $server
43
-	 * @param DOMElement $errorNode
44
-	 * @return void
45
-	 */
46
-	public function serialize(Server $server, DOMElement $errorNode) {
47
-
48
-		// set ownCloud namespace
49
-		$errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
50
-
51
-		$error = $errorNode->ownerDocument->createElementNS('o:', 'o:hint', 'password login forbidden');
52
-		$errorNode->appendChild($error);
53
-	}
32
+    const NS_OWNCLOUD = 'http://owncloud.org/ns';
33
+
34
+    public function getHTTPCode() {
35
+        return 401;
36
+    }
37
+
38
+    /**
39
+     * This method allows the exception to include additional information
40
+     * into the WebDAV error response
41
+     *
42
+     * @param Server $server
43
+     * @param DOMElement $errorNode
44
+     * @return void
45
+     */
46
+    public function serialize(Server $server, DOMElement $errorNode) {
47
+
48
+        // set ownCloud namespace
49
+        $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
50
+
51
+        $error = $errorNode->ownerDocument->createElementNS('o:', 'o:hint', 'password login forbidden');
52
+        $errorNode->appendChild($error);
53
+    }
54 54
 
55 55
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/FileLocked.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -30,20 +30,20 @@
 block discarded – undo
30 30
 
31 31
 class FileLocked extends \Sabre\DAV\Exception {
32 32
 
33
-	public function __construct($message = "", $code = 0, Exception $previous = null) {
34
-		if($previous instanceof \OCP\Files\LockNotAcquiredException) {
35
-			$message = sprintf('Target file %s is locked by another process.', $previous->path);
36
-		}
37
-		parent::__construct($message, $code, $previous);
38
-	}
33
+    public function __construct($message = "", $code = 0, Exception $previous = null) {
34
+        if($previous instanceof \OCP\Files\LockNotAcquiredException) {
35
+            $message = sprintf('Target file %s is locked by another process.', $previous->path);
36
+        }
37
+        parent::__construct($message, $code, $previous);
38
+    }
39 39
 
40
-	/**
41
-	 * Returns the HTTP status code for this exception
42
-	 *
43
-	 * @return int
44
-	 */
45
-	public function getHTTPCode() {
40
+    /**
41
+     * Returns the HTTP status code for this exception
42
+     *
43
+     * @return int
44
+     */
45
+    public function getHTTPCode() {
46 46
 
47
-		return 423;
48
-	}
47
+        return 423;
48
+    }
49 49
 }
Please login to merge, or discard this 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/Exception/UnsupportedMediaType.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,15 +31,15 @@
 block discarded – undo
31 31
  */
32 32
 class UnsupportedMediaType extends \Sabre\DAV\Exception {
33 33
 
34
-	/**
35
-	 * Returns the HTTP status code for this exception
36
-	 *
37
-	 * @return int
38
-	 */
39
-	public function getHTTPCode() {
34
+    /**
35
+     * Returns the HTTP status code for this exception
36
+     *
37
+     * @return int
38
+     */
39
+    public function getHTTPCode() {
40 40
 
41
-		return 415;
41
+        return 415;
42 42
 
43
-	}
43
+    }
44 44
 
45 45
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/EntityTooLarge.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,15 +31,15 @@
 block discarded – undo
31 31
  */
32 32
 class EntityTooLarge extends \Sabre\DAV\Exception {
33 33
 
34
-	/**
35
-	 * Returns the HTTP status code for this exception
36
-	 *
37
-	 * @return int
38
-	 */
39
-	public function getHTTPCode() {
34
+    /**
35
+     * Returns the HTTP status code for this exception
36
+     *
37
+     * @return int
38
+     */
39
+    public function getHTTPCode() {
40 40
 
41
-		return 413;
41
+        return 413;
42 42
 
43
-	}
43
+    }
44 44
 
45 45
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/CustomPropertiesBackend.php 2 patches
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.
Indentation   +310 added lines, -310 removed lines patch added patch discarded remove patch
@@ -36,315 +36,315 @@
 block discarded – undo
36 36
 
37 37
 class CustomPropertiesBackend implements BackendInterface {
38 38
 
39
-	/**
40
-	 * Ignored properties
41
-	 *
42
-	 * @var array
43
-	 */
44
-	private $ignoredProperties = array(
45
-		'{DAV:}getcontentlength',
46
-		'{DAV:}getcontenttype',
47
-		'{DAV:}getetag',
48
-		'{DAV:}quota-used-bytes',
49
-		'{DAV:}quota-available-bytes',
50
-		'{http://owncloud.org/ns}permissions',
51
-		'{http://owncloud.org/ns}downloadURL',
52
-		'{http://owncloud.org/ns}dDC',
53
-		'{http://owncloud.org/ns}size',
54
-		'{http://nextcloud.org/ns}is-encrypted',
55
-	);
56
-
57
-	/**
58
-	 * @var Tree
59
-	 */
60
-	private $tree;
61
-
62
-	/**
63
-	 * @var IDBConnection
64
-	 */
65
-	private $connection;
66
-
67
-	/**
68
-	 * @var IUser
69
-	 */
70
-	private $user;
71
-
72
-	/**
73
-	 * Properties cache
74
-	 *
75
-	 * @var array
76
-	 */
77
-	private $cache = [];
78
-
79
-	/**
80
-	 * @param Tree $tree node tree
81
-	 * @param IDBConnection $connection database connection
82
-	 * @param IUser $user owner of the tree and properties
83
-	 */
84
-	public function __construct(
85
-		Tree $tree,
86
-		IDBConnection $connection,
87
-		IUser $user) {
88
-		$this->tree = $tree;
89
-		$this->connection = $connection;
90
-		$this->user = $user->getUID();
91
-	}
92
-
93
-	/**
94
-	 * Fetches properties for a path.
95
-	 *
96
-	 * @param string $path
97
-	 * @param PropFind $propFind
98
-	 * @return void
99
-	 */
100
-	public function propFind($path, PropFind $propFind) {
101
-		try {
102
-			$node = $this->tree->getNodeForPath($path);
103
-			if (!($node instanceof Node)) {
104
-				return;
105
-			}
106
-		} catch (ServiceUnavailable $e) {
107
-			// might happen for unavailable mount points, skip
108
-			return;
109
-		} catch (NotFound $e) {
110
-			// in some rare (buggy) cases the node might not be found,
111
-			// we catch the exception to prevent breaking the whole list with a 404
112
-			// (soft fail)
113
-			\OC::$server->getLogger()->warning(
114
-				'Could not get node for path: \"' . $path . '\" : ' . $e->getMessage(),
115
-				array('app' => 'files')
116
-			);
117
-			return;
118
-		}
119
-
120
-		$requestedProps = $propFind->get404Properties();
121
-
122
-		// these might appear
123
-		$requestedProps = array_diff(
124
-			$requestedProps,
125
-			$this->ignoredProperties
126
-		);
127
-
128
-		if (empty($requestedProps)) {
129
-			return;
130
-		}
131
-
132
-		$props = $this->getProperties($node, $requestedProps);
133
-		foreach ($props as $propName => $propValue) {
134
-			$propFind->set($propName, $propValue);
135
-		}
136
-	}
137
-
138
-	/**
139
-	 * Updates properties for a path
140
-	 *
141
-	 * @param string $path
142
-	 * @param PropPatch $propPatch
143
-	 *
144
-	 * @return void
145
-	 */
146
-	public function propPatch($path, PropPatch $propPatch) {
147
-		$node = $this->tree->getNodeForPath($path);
148
-		if (!($node instanceof Node)) {
149
-			return;
150
-		}
151
-
152
-		$propPatch->handleRemaining(function($changedProps) use ($node) {
153
-			return $this->updateProperties($node, $changedProps);
154
-		});
155
-	}
156
-
157
-	/**
158
-	 * This method is called after a node is deleted.
159
-	 *
160
-	 * @param string $path path of node for which to delete properties
161
-	 */
162
-	public function delete($path) {
163
-		$statement = $this->connection->prepare(
164
-			'DELETE FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?'
165
-		);
166
-		$statement->execute(array($this->user, '/' . $path));
167
-		$statement->closeCursor();
168
-
169
-		unset($this->cache[$path]);
170
-	}
171
-
172
-	/**
173
-	 * This method is called after a successful MOVE
174
-	 *
175
-	 * @param string $source
176
-	 * @param string $destination
177
-	 *
178
-	 * @return void
179
-	 */
180
-	public function move($source, $destination) {
181
-		$statement = $this->connection->prepare(
182
-			'UPDATE `*PREFIX*properties` SET `propertypath` = ?' .
183
-			' WHERE `userid` = ? AND `propertypath` = ?'
184
-		);
185
-		$statement->execute(array('/' . $destination, $this->user, '/' . $source));
186
-		$statement->closeCursor();
187
-	}
188
-
189
-	/**
190
-	 * Returns a list of properties for this nodes.;
191
-	 * @param Node $node
192
-	 * @param array $requestedProperties requested properties or empty array for "all"
193
-	 * @return array
194
-	 * @note The properties list is a list of propertynames the client
195
-	 * requested, encoded as xmlnamespace#tagName, for example:
196
-	 * http://www.example.org/namespace#author If the array is empty, all
197
-	 * properties should be returned
198
-	 */
199
-	private function getProperties(Node $node, array $requestedProperties) {
200
-		$path = $node->getPath();
201
-		if (isset($this->cache[$path])) {
202
-			return $this->cache[$path];
203
-		}
204
-
205
-		// TODO: chunking if more than 1000 properties
206
-		$sql = 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?';
207
-
208
-		$whereValues = array($this->user, $path);
209
-		$whereTypes = array(null, null);
210
-
211
-		if (!empty($requestedProperties)) {
212
-			// request only a subset
213
-			$sql .= ' AND `propertyname` in (?)';
214
-			$whereValues[] = $requestedProperties;
215
-			$whereTypes[] = \Doctrine\DBAL\Connection::PARAM_STR_ARRAY;
216
-		}
217
-
218
-		$result = $this->connection->executeQuery(
219
-			$sql,
220
-			$whereValues,
221
-			$whereTypes
222
-		);
223
-
224
-		$props = [];
225
-		while ($row = $result->fetch()) {
226
-			$props[$row['propertyname']] = $row['propertyvalue'];
227
-		}
228
-
229
-		$result->closeCursor();
230
-
231
-		$this->cache[$path] = $props;
232
-		return $props;
233
-	}
234
-
235
-	/**
236
-	 * Update properties
237
-	 *
238
-	 * @param Node $node node for which to update properties
239
-	 * @param array $properties array of properties to update
240
-	 *
241
-	 * @return bool
242
-	 */
243
-	private function updateProperties($node, $properties) {
244
-		$path = $node->getPath();
245
-
246
-		$deleteStatement = 'DELETE FROM `*PREFIX*properties`' .
247
-			' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?';
248
-
249
-		$insertStatement = 'INSERT INTO `*PREFIX*properties`' .
250
-			' (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)';
251
-
252
-		$updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?' .
253
-			' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?';
254
-
255
-		// TODO: use "insert or update" strategy ?
256
-		$existing = $this->getProperties($node, array());
257
-		$this->connection->beginTransaction();
258
-		foreach ($properties as $propertyName => $propertyValue) {
259
-			// If it was null, we need to delete the property
260
-			if (is_null($propertyValue)) {
261
-				if (array_key_exists($propertyName, $existing)) {
262
-					$this->connection->executeUpdate($deleteStatement,
263
-						array(
264
-							$this->user,
265
-							$path,
266
-							$propertyName
267
-						)
268
-					);
269
-				}
270
-			} else {
271
-				if (!array_key_exists($propertyName, $existing)) {
272
-					$this->connection->executeUpdate($insertStatement,
273
-						array(
274
-							$this->user,
275
-							$path,
276
-							$propertyName,
277
-							$propertyValue
278
-						)
279
-					);
280
-				} else {
281
-					$this->connection->executeUpdate($updateStatement,
282
-						array(
283
-							$propertyValue,
284
-							$this->user,
285
-							$path,
286
-							$propertyName
287
-						)
288
-					);
289
-				}
290
-			}
291
-		}
292
-
293
-		$this->connection->commit();
294
-		unset($this->cache[$path]);
295
-
296
-		return true;
297
-	}
298
-
299
-	/**
300
-	 * Bulk load properties for directory children
301
-	 *
302
-	 * @param Directory $node
303
-	 * @param array $requestedProperties requested properties
304
-	 *
305
-	 * @return void
306
-	 */
307
-	private function loadChildrenProperties(Directory $node, $requestedProperties) {
308
-		$path = $node->getPath();
309
-		if (isset($this->cache[$path])) {
310
-			// we already loaded them at some point
311
-			return;
312
-		}
313
-
314
-		$childNodes = $node->getChildren();
315
-		// pre-fill cache
316
-		foreach ($childNodes as $childNode) {
317
-			$this->cache[$childNode->getPath()] = [];
318
-		}
319
-
320
-		$sql = 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` LIKE ?';
321
-		$sql .= ' AND `propertyname` in (?) ORDER BY `propertypath`, `propertyname`';
322
-
323
-		$result = $this->connection->executeQuery(
324
-			$sql,
325
-			array($this->user, $this->connection->escapeLikeParameter(rtrim($path, '/')) . '/%', $requestedProperties),
326
-			array(null, null, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY)
327
-		);
328
-
329
-		$oldPath = null;
330
-		$props = [];
331
-		while ($row = $result->fetch()) {
332
-			$path = $row['propertypath'];
333
-			if ($oldPath !== $path) {
334
-				// save previously gathered props
335
-				$this->cache[$oldPath] = $props;
336
-				$oldPath = $path;
337
-				// prepare props for next path
338
-				$props = [];
339
-			}
340
-			$props[$row['propertyname']] = $row['propertyvalue'];
341
-		}
342
-		if (!is_null($oldPath)) {
343
-			// save props from last run
344
-			$this->cache[$oldPath] = $props;
345
-		}
346
-
347
-		$result->closeCursor();
348
-	}
39
+    /**
40
+     * Ignored properties
41
+     *
42
+     * @var array
43
+     */
44
+    private $ignoredProperties = array(
45
+        '{DAV:}getcontentlength',
46
+        '{DAV:}getcontenttype',
47
+        '{DAV:}getetag',
48
+        '{DAV:}quota-used-bytes',
49
+        '{DAV:}quota-available-bytes',
50
+        '{http://owncloud.org/ns}permissions',
51
+        '{http://owncloud.org/ns}downloadURL',
52
+        '{http://owncloud.org/ns}dDC',
53
+        '{http://owncloud.org/ns}size',
54
+        '{http://nextcloud.org/ns}is-encrypted',
55
+    );
56
+
57
+    /**
58
+     * @var Tree
59
+     */
60
+    private $tree;
61
+
62
+    /**
63
+     * @var IDBConnection
64
+     */
65
+    private $connection;
66
+
67
+    /**
68
+     * @var IUser
69
+     */
70
+    private $user;
71
+
72
+    /**
73
+     * Properties cache
74
+     *
75
+     * @var array
76
+     */
77
+    private $cache = [];
78
+
79
+    /**
80
+     * @param Tree $tree node tree
81
+     * @param IDBConnection $connection database connection
82
+     * @param IUser $user owner of the tree and properties
83
+     */
84
+    public function __construct(
85
+        Tree $tree,
86
+        IDBConnection $connection,
87
+        IUser $user) {
88
+        $this->tree = $tree;
89
+        $this->connection = $connection;
90
+        $this->user = $user->getUID();
91
+    }
92
+
93
+    /**
94
+     * Fetches properties for a path.
95
+     *
96
+     * @param string $path
97
+     * @param PropFind $propFind
98
+     * @return void
99
+     */
100
+    public function propFind($path, PropFind $propFind) {
101
+        try {
102
+            $node = $this->tree->getNodeForPath($path);
103
+            if (!($node instanceof Node)) {
104
+                return;
105
+            }
106
+        } catch (ServiceUnavailable $e) {
107
+            // might happen for unavailable mount points, skip
108
+            return;
109
+        } catch (NotFound $e) {
110
+            // in some rare (buggy) cases the node might not be found,
111
+            // we catch the exception to prevent breaking the whole list with a 404
112
+            // (soft fail)
113
+            \OC::$server->getLogger()->warning(
114
+                'Could not get node for path: \"' . $path . '\" : ' . $e->getMessage(),
115
+                array('app' => 'files')
116
+            );
117
+            return;
118
+        }
119
+
120
+        $requestedProps = $propFind->get404Properties();
121
+
122
+        // these might appear
123
+        $requestedProps = array_diff(
124
+            $requestedProps,
125
+            $this->ignoredProperties
126
+        );
127
+
128
+        if (empty($requestedProps)) {
129
+            return;
130
+        }
131
+
132
+        $props = $this->getProperties($node, $requestedProps);
133
+        foreach ($props as $propName => $propValue) {
134
+            $propFind->set($propName, $propValue);
135
+        }
136
+    }
137
+
138
+    /**
139
+     * Updates properties for a path
140
+     *
141
+     * @param string $path
142
+     * @param PropPatch $propPatch
143
+     *
144
+     * @return void
145
+     */
146
+    public function propPatch($path, PropPatch $propPatch) {
147
+        $node = $this->tree->getNodeForPath($path);
148
+        if (!($node instanceof Node)) {
149
+            return;
150
+        }
151
+
152
+        $propPatch->handleRemaining(function($changedProps) use ($node) {
153
+            return $this->updateProperties($node, $changedProps);
154
+        });
155
+    }
156
+
157
+    /**
158
+     * This method is called after a node is deleted.
159
+     *
160
+     * @param string $path path of node for which to delete properties
161
+     */
162
+    public function delete($path) {
163
+        $statement = $this->connection->prepare(
164
+            'DELETE FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?'
165
+        );
166
+        $statement->execute(array($this->user, '/' . $path));
167
+        $statement->closeCursor();
168
+
169
+        unset($this->cache[$path]);
170
+    }
171
+
172
+    /**
173
+     * This method is called after a successful MOVE
174
+     *
175
+     * @param string $source
176
+     * @param string $destination
177
+     *
178
+     * @return void
179
+     */
180
+    public function move($source, $destination) {
181
+        $statement = $this->connection->prepare(
182
+            'UPDATE `*PREFIX*properties` SET `propertypath` = ?' .
183
+            ' WHERE `userid` = ? AND `propertypath` = ?'
184
+        );
185
+        $statement->execute(array('/' . $destination, $this->user, '/' . $source));
186
+        $statement->closeCursor();
187
+    }
188
+
189
+    /**
190
+     * Returns a list of properties for this nodes.;
191
+     * @param Node $node
192
+     * @param array $requestedProperties requested properties or empty array for "all"
193
+     * @return array
194
+     * @note The properties list is a list of propertynames the client
195
+     * requested, encoded as xmlnamespace#tagName, for example:
196
+     * http://www.example.org/namespace#author If the array is empty, all
197
+     * properties should be returned
198
+     */
199
+    private function getProperties(Node $node, array $requestedProperties) {
200
+        $path = $node->getPath();
201
+        if (isset($this->cache[$path])) {
202
+            return $this->cache[$path];
203
+        }
204
+
205
+        // TODO: chunking if more than 1000 properties
206
+        $sql = 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?';
207
+
208
+        $whereValues = array($this->user, $path);
209
+        $whereTypes = array(null, null);
210
+
211
+        if (!empty($requestedProperties)) {
212
+            // request only a subset
213
+            $sql .= ' AND `propertyname` in (?)';
214
+            $whereValues[] = $requestedProperties;
215
+            $whereTypes[] = \Doctrine\DBAL\Connection::PARAM_STR_ARRAY;
216
+        }
217
+
218
+        $result = $this->connection->executeQuery(
219
+            $sql,
220
+            $whereValues,
221
+            $whereTypes
222
+        );
223
+
224
+        $props = [];
225
+        while ($row = $result->fetch()) {
226
+            $props[$row['propertyname']] = $row['propertyvalue'];
227
+        }
228
+
229
+        $result->closeCursor();
230
+
231
+        $this->cache[$path] = $props;
232
+        return $props;
233
+    }
234
+
235
+    /**
236
+     * Update properties
237
+     *
238
+     * @param Node $node node for which to update properties
239
+     * @param array $properties array of properties to update
240
+     *
241
+     * @return bool
242
+     */
243
+    private function updateProperties($node, $properties) {
244
+        $path = $node->getPath();
245
+
246
+        $deleteStatement = 'DELETE FROM `*PREFIX*properties`' .
247
+            ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?';
248
+
249
+        $insertStatement = 'INSERT INTO `*PREFIX*properties`' .
250
+            ' (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)';
251
+
252
+        $updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?' .
253
+            ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?';
254
+
255
+        // TODO: use "insert or update" strategy ?
256
+        $existing = $this->getProperties($node, array());
257
+        $this->connection->beginTransaction();
258
+        foreach ($properties as $propertyName => $propertyValue) {
259
+            // If it was null, we need to delete the property
260
+            if (is_null($propertyValue)) {
261
+                if (array_key_exists($propertyName, $existing)) {
262
+                    $this->connection->executeUpdate($deleteStatement,
263
+                        array(
264
+                            $this->user,
265
+                            $path,
266
+                            $propertyName
267
+                        )
268
+                    );
269
+                }
270
+            } else {
271
+                if (!array_key_exists($propertyName, $existing)) {
272
+                    $this->connection->executeUpdate($insertStatement,
273
+                        array(
274
+                            $this->user,
275
+                            $path,
276
+                            $propertyName,
277
+                            $propertyValue
278
+                        )
279
+                    );
280
+                } else {
281
+                    $this->connection->executeUpdate($updateStatement,
282
+                        array(
283
+                            $propertyValue,
284
+                            $this->user,
285
+                            $path,
286
+                            $propertyName
287
+                        )
288
+                    );
289
+                }
290
+            }
291
+        }
292
+
293
+        $this->connection->commit();
294
+        unset($this->cache[$path]);
295
+
296
+        return true;
297
+    }
298
+
299
+    /**
300
+     * Bulk load properties for directory children
301
+     *
302
+     * @param Directory $node
303
+     * @param array $requestedProperties requested properties
304
+     *
305
+     * @return void
306
+     */
307
+    private function loadChildrenProperties(Directory $node, $requestedProperties) {
308
+        $path = $node->getPath();
309
+        if (isset($this->cache[$path])) {
310
+            // we already loaded them at some point
311
+            return;
312
+        }
313
+
314
+        $childNodes = $node->getChildren();
315
+        // pre-fill cache
316
+        foreach ($childNodes as $childNode) {
317
+            $this->cache[$childNode->getPath()] = [];
318
+        }
319
+
320
+        $sql = 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` LIKE ?';
321
+        $sql .= ' AND `propertyname` in (?) ORDER BY `propertypath`, `propertyname`';
322
+
323
+        $result = $this->connection->executeQuery(
324
+            $sql,
325
+            array($this->user, $this->connection->escapeLikeParameter(rtrim($path, '/')) . '/%', $requestedProperties),
326
+            array(null, null, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY)
327
+        );
328
+
329
+        $oldPath = null;
330
+        $props = [];
331
+        while ($row = $result->fetch()) {
332
+            $path = $row['propertypath'];
333
+            if ($oldPath !== $path) {
334
+                // save previously gathered props
335
+                $this->cache[$oldPath] = $props;
336
+                $oldPath = $path;
337
+                // prepare props for next path
338
+                $props = [];
339
+            }
340
+            $props[$row['propertyname']] = $row['propertyvalue'];
341
+        }
342
+        if (!is_null($oldPath)) {
343
+            // save props from last run
344
+            $this->cache[$oldPath] = $props;
345
+        }
346
+
347
+        $result->closeCursor();
348
+    }
349 349
 
350 350
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/TagList.php 2 patches
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -34,92 +34,92 @@
 block discarded – undo
34 34
  * This property contains multiple "tag" elements, each containing a tag name.
35 35
  */
36 36
 class TagList implements Element {
37
-	const NS_OWNCLOUD = 'http://owncloud.org/ns';
37
+    const NS_OWNCLOUD = 'http://owncloud.org/ns';
38 38
 
39
-	/**
40
-	 * tags
41
-	 *
42
-	 * @var array
43
-	 */
44
-	private $tags;
39
+    /**
40
+     * tags
41
+     *
42
+     * @var array
43
+     */
44
+    private $tags;
45 45
 
46
-	/**
47
-	 * @param array $tags
48
-	 */
49
-	public function __construct(array $tags) {
50
-		$this->tags = $tags;
51
-	}
46
+    /**
47
+     * @param array $tags
48
+     */
49
+    public function __construct(array $tags) {
50
+        $this->tags = $tags;
51
+    }
52 52
 
53
-	/**
54
-	 * Returns the tags
55
-	 *
56
-	 * @return array
57
-	 */
58
-	public function getTags() {
53
+    /**
54
+     * Returns the tags
55
+     *
56
+     * @return array
57
+     */
58
+    public function getTags() {
59 59
 
60
-		return $this->tags;
60
+        return $this->tags;
61 61
 
62
-	}
62
+    }
63 63
 
64
-	/**
65
-	 * The deserialize method is called during xml parsing.
66
-	 *
67
-	 * This method is called statictly, this is because in theory this method
68
-	 * may be used as a type of constructor, or factory method.
69
-	 *
70
-	 * Often you want to return an instance of the current class, but you are
71
-	 * free to return other data as well.
72
-	 *
73
-	 * You are responsible for advancing the reader to the next element. Not
74
-	 * doing anything will result in a never-ending loop.
75
-	 *
76
-	 * If you just want to skip parsing for this element altogether, you can
77
-	 * just call $reader->next();
78
-	 *
79
-	 * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
80
-	 * the next element.
81
-	 *
82
-	 * @param Reader $reader
83
-	 * @return mixed
84
-	 */
85
-	static function xmlDeserialize(Reader $reader) {
86
-		$tags = [];
64
+    /**
65
+     * The deserialize method is called during xml parsing.
66
+     *
67
+     * This method is called statictly, this is because in theory this method
68
+     * may be used as a type of constructor, or factory method.
69
+     *
70
+     * Often you want to return an instance of the current class, but you are
71
+     * free to return other data as well.
72
+     *
73
+     * You are responsible for advancing the reader to the next element. Not
74
+     * doing anything will result in a never-ending loop.
75
+     *
76
+     * If you just want to skip parsing for this element altogether, you can
77
+     * just call $reader->next();
78
+     *
79
+     * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
80
+     * the next element.
81
+     *
82
+     * @param Reader $reader
83
+     * @return mixed
84
+     */
85
+    static function xmlDeserialize(Reader $reader) {
86
+        $tags = [];
87 87
 
88
-		$tree = $reader->parseInnerTree();
89
-		if ($tree === null) {
90
-			return null;
91
-		}
92
-		foreach ($tree as $elem) {
93
-			if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}tag') {
94
-				$tags[] = $elem['value'];
95
-			}
96
-		}
97
-		return new self($tags);
98
-	}
88
+        $tree = $reader->parseInnerTree();
89
+        if ($tree === null) {
90
+            return null;
91
+        }
92
+        foreach ($tree as $elem) {
93
+            if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}tag') {
94
+                $tags[] = $elem['value'];
95
+            }
96
+        }
97
+        return new self($tags);
98
+    }
99 99
 
100
-	/**
101
-	 * The xmlSerialize metod is called during xml writing.
102
-	 *
103
-	 * Use the $writer argument to write its own xml serialization.
104
-	 *
105
-	 * An important note: do _not_ create a parent element. Any element
106
-	 * implementing XmlSerializble should only ever write what's considered
107
-	 * its 'inner xml'.
108
-	 *
109
-	 * The parent of the current element is responsible for writing a
110
-	 * containing element.
111
-	 *
112
-	 * This allows serializers to be re-used for different element names.
113
-	 *
114
-	 * If you are opening new elements, you must also close them again.
115
-	 *
116
-	 * @param Writer $writer
117
-	 * @return void
118
-	 */
119
-	function xmlSerialize(Writer $writer) {
100
+    /**
101
+     * The xmlSerialize metod is called during xml writing.
102
+     *
103
+     * Use the $writer argument to write its own xml serialization.
104
+     *
105
+     * An important note: do _not_ create a parent element. Any element
106
+     * implementing XmlSerializble should only ever write what's considered
107
+     * its 'inner xml'.
108
+     *
109
+     * The parent of the current element is responsible for writing a
110
+     * containing element.
111
+     *
112
+     * This allows serializers to be re-used for different element names.
113
+     *
114
+     * If you are opening new elements, you must also close them again.
115
+     *
116
+     * @param Writer $writer
117
+     * @return void
118
+     */
119
+    function xmlSerialize(Writer $writer) {
120 120
 
121
-		foreach ($this->tags as $tag) {
122
-			$writer->writeElement('{' . self::NS_OWNCLOUD . '}tag', $tag);
123
-		}
124
-	}
121
+        foreach ($this->tags as $tag) {
122
+            $writer->writeElement('{' . self::NS_OWNCLOUD . '}tag', $tag);
123
+        }
124
+    }
125 125
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 			return null;
91 91
 		}
92 92
 		foreach ($tree as $elem) {
93
-			if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}tag') {
93
+			if ($elem['name'] === '{'.self::NS_OWNCLOUD.'}tag') {
94 94
 				$tags[] = $elem['value'];
95 95
 			}
96 96
 		}
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	function xmlSerialize(Writer $writer) {
120 120
 
121 121
 		foreach ($this->tags as $tag) {
122
-			$writer->writeElement('{' . self::NS_OWNCLOUD . '}tag', $tag);
122
+			$writer->writeElement('{'.self::NS_OWNCLOUD.'}tag', $tag);
123 123
 		}
124 124
 	}
125 125
 }
Please login to merge, or discard this patch.