Completed
Pull Request — stable10 (#6492)
by Morris
11:41
created
apps/dav/lib/CardDAV/Xml/Groups.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,6 @@
 block discarded – undo
21 21
 namespace OCA\DAV\CardDAV\Xml;
22 22
 
23 23
 use Sabre\Xml\XmlSerializable;
24
-use Sabre\Xml\Element;
25 24
 use Sabre\Xml\Writer;
26 25
 
27 26
 class Groups implements XmlSerializable {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
 
41 41
 	function xmlSerialize(Writer $writer) {
42 42
 		foreach ($this->groups as $group) {
43
-			$writer->writeElement('{' . self::NS_OWNCLOUD . '}group', $group);
43
+			$writer->writeElement('{'.self::NS_OWNCLOUD.'}group', $group);
44 44
 		}
45 45
 	}
46 46
 }
Please login to merge, or discard this patch.
apps/dav/lib/Command/CreateAddressBook.php 1 patch
Unused Use Statements   -5 removed lines patch added patch discarded remove patch
@@ -22,11 +22,6 @@
 block discarded – undo
22 22
 namespace OCA\DAV\Command;
23 23
 
24 24
 use OCA\DAV\CardDAV\CardDavBackend;
25
-use OCA\DAV\Connector\Sabre\Principal;
26
-use OCP\IConfig;
27
-use OCP\IDBConnection;
28
-use OCP\IGroupManager;
29
-use OCP\ILogger;
30 25
 use OCP\IUserManager;
31 26
 use Symfony\Component\Console\Command\Command;
32 27
 use Symfony\Component\Console\Input\InputArgument;
Please login to merge, or discard this patch.
apps/dav/lib/Command/SyncSystemAddressBook.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -21,10 +21,8 @@
 block discarded – undo
21 21
 namespace OCA\DAV\Command;
22 22
 
23 23
 use OCA\DAV\CardDAV\SyncService;
24
-use OCP\IUserManager;
25 24
 use Symfony\Component\Console\Command\Command;
26 25
 use Symfony\Component\Console\Helper\ProgressBar;
27
-use Symfony\Component\Console\Input\InputArgument;
28 26
 use Symfony\Component\Console\Input\InputInterface;
29 27
 use Symfony\Component\Console\Output\OutputInterface;
30 28
 
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/ChecksumList.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,6 @@
 block discarded – undo
21 21
 namespace OCA\DAV\Connector\Sabre;
22 22
 
23 23
 use Sabre\Xml\XmlSerializable;
24
-use Sabre\Xml\Element;
25 24
 use Sabre\Xml\Writer;
26 25
 
27 26
 /**
Please login to merge, or discard this 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/DAV/Sharing/Plugin.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
 use OCA\DAV\Connector\Sabre\Auth;
25 25
 use OCA\DAV\DAV\Sharing\Xml\Invite;
26 26
 use OCP\IRequest;
27
-use Sabre\DAV\Exception\BadRequest;
28 27
 use Sabre\DAV\Exception\NotFound;
29 28
 use Sabre\DAV\INode;
30 29
 use Sabre\DAV\PropFind;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 	function initialize(Server $server) {
101 101
 		$this->server = $server;
102
-		$this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}share'] = 'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest';
103
-		$this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}invite'] = 'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite';
102
+		$this->server->xml->elementMap['{'.Plugin::NS_OWNCLOUD.'}share'] = 'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest';
103
+		$this->server->xml->elementMap['{'.Plugin::NS_OWNCLOUD.'}invite'] = 'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite';
104 104
 
105 105
 		$this->server->on('method:POST', [$this, 'httpPost']);
106
-		$this->server->on('propFind',    [$this, 'propFind']);
106
+		$this->server->on('propFind', [$this, 'propFind']);
107 107
 	}
108 108
 
109 109
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
 			// Dealing with the 'share' document, which modified invitees on a
148 148
 			// calendar.
149
-			case '{' . self::NS_OWNCLOUD . '}share' :
149
+			case '{'.self::NS_OWNCLOUD.'}share' :
150 150
 
151 151
 				// We can only deal with IShareableCalendar objects
152 152
 				if (!$node instanceof IShareable) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	function propFind(PropFind $propFind, INode $node) {
190 190
 		if ($node instanceof IShareable) {
191 191
 
192
-			$propFind->handle('{' . Plugin::NS_OWNCLOUD . '}invite', function() use ($node) {
192
+			$propFind->handle('{'.Plugin::NS_OWNCLOUD.'}invite', function() use ($node) {
193 193
 				return new Invite(
194 194
 					$node->getShares()
195 195
 				);
Please login to merge, or discard this patch.
apps/dav/lib/SystemTag/SystemTagPlugin.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -29,9 +29,7 @@
 block discarded – undo
29 29
 use Sabre\DAV\Exception\BadRequest;
30 30
 use Sabre\DAV\Exception\Conflict;
31 31
 use Sabre\DAV\Exception\Forbidden;
32
-use Sabre\DAV\Exception\NotFound;
33 32
 use Sabre\DAV\Exception\UnsupportedMediaType;
34
-
35 33
 use OCP\SystemTag\ISystemTag;
36 34
 use OCP\SystemTag\ISystemTagManager;
37 35
 use OCP\SystemTag\TagAlreadyExistsException;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 			if ($node instanceof SystemTagsObjectMappingCollection) {
136 136
 				// also add to collection
137 137
 				$node->createFile($tag->getId());
138
-				$url = $request->getBaseUrl() . 'systemtags/';
138
+				$url = $request->getBaseUrl().'systemtags/';
139 139
 			} else {
140 140
 				$url = $request->getUrl();
141 141
 			}
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 				$url .= '/';
145 145
 			}
146 146
 
147
-			$response->setHeader('Content-Location', $url . $tag->getId());
147
+			$response->setHeader('Content-Location', $url.$tag->getId());
148 148
 
149 149
 			// created
150 150
 			$response->setStatus(201);
@@ -179,11 +179,11 @@  discard block
 block discarded – undo
179 179
 		$userAssignable = true;
180 180
 
181 181
 		if (isset($data['userVisible'])) {
182
-			$userVisible = (bool)$data['userVisible'];
182
+			$userVisible = (bool) $data['userVisible'];
183 183
 		}
184 184
 
185 185
 		if (isset($data['userAssignable'])) {
186
-			$userAssignable = (bool)$data['userAssignable'];
186
+			$userAssignable = (bool) $data['userAssignable'];
187 187
 		}
188 188
 
189 189
 		$groups = [];
@@ -194,8 +194,8 @@  discard block
 block discarded – undo
194 194
 			}
195 195
 		}
196 196
 
197
-		if($userVisible === false || $userAssignable === false || !empty($groups)) {
198
-			if(!$this->userSession->isLoggedIn() || !$this->groupManager->isAdmin($this->userSession->getUser()->getUID())) {
197
+		if ($userVisible === false || $userAssignable === false || !empty($groups)) {
198
+			if (!$this->userSession->isLoggedIn() || !$this->groupManager->isAdmin($this->userSession->getUser()->getUID())) {
199 199
 				throw new BadRequest('Not sufficient permissions');
200 200
 			}
201 201
 		}
Please login to merge, or discard this patch.
apps/dav/lib/SystemTag/SystemTagsByIdCollection.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -26,13 +26,11 @@
 block discarded – undo
26 26
 use Sabre\DAV\Exception\NotFound;
27 27
 use Sabre\DAV\Exception\BadRequest;
28 28
 use Sabre\DAV\ICollection;
29
-
30 29
 use OCP\SystemTag\ISystemTagManager;
31 30
 use OCP\SystemTag\ISystemTag;
32 31
 use OCP\SystemTag\TagNotFoundException;
33 32
 use OCP\IGroupManager;
34 33
 use OCP\IUserSession;
35
-use OC\User\NoUserException;
36 34
 
37 35
 class SystemTagsByIdCollection implements ICollection {
38 36
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -106,13 +106,13 @@
 block discarded – undo
106 106
 			$tag = $this->tagManager->getTagsByIds([$name]);
107 107
 			$tag = current($tag);
108 108
 			if (!$this->tagManager->canUserSeeTag($tag, $this->userSession->getUser())) {
109
-				throw new NotFound('Tag with id ' . $name . ' not found');
109
+				throw new NotFound('Tag with id '.$name.' not found');
110 110
 			}
111 111
 			return $this->makeNode($tag);
112 112
 		} catch (\InvalidArgumentException $e) {
113 113
 			throw new BadRequest('Invalid tag id', 0, $e);
114 114
 		} catch (TagNotFoundException $e) {
115
-			throw new NotFound('Tag with id ' . $name . ' not found', 0, $e);
115
+			throw new NotFound('Tag with id '.$name.' not found', 0, $e);
116 116
 		}
117 117
 	}
118 118
 
Please login to merge, or discard this patch.
apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,6 @@
 block discarded – undo
26 26
 use Sabre\DAV\Exception\BadRequest;
27 27
 use Sabre\DAV\Exception\PreconditionFailed;
28 28
 use Sabre\DAV\ICollection;
29
-
30 29
 use OCP\SystemTag\ISystemTagManager;
31 30
 use OCP\SystemTag\ISystemTagObjectMapper;
32 31
 use OCP\SystemTag\ISystemTag;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -95,15 +95,15 @@  discard block
 block discarded – undo
95 95
 			$tags = $this->tagManager->getTagsByIds([$tagId]);
96 96
 			$tag = current($tags);
97 97
 			if (!$this->tagManager->canUserSeeTag($tag, $this->user)) {
98
-				throw new PreconditionFailed('Tag with id ' . $tagId . ' does not exist, cannot assign');
98
+				throw new PreconditionFailed('Tag with id '.$tagId.' does not exist, cannot assign');
99 99
 			}
100 100
 			if (!$this->tagManager->canUserAssignTag($tag, $this->user)) {
101
-				throw new Forbidden('No permission to assign tag ' . $tagId);
101
+				throw new Forbidden('No permission to assign tag '.$tagId);
102 102
 			}
103 103
 
104 104
 			$this->tagMapper->assignTags($this->objectId, $this->objectType, $tagId);
105 105
 		} catch (TagNotFoundException $e) {
106
-			throw new PreconditionFailed('Tag with id ' . $tagId . ' does not exist, cannot assign');
106
+			throw new PreconditionFailed('Tag with id '.$tagId.' does not exist, cannot assign');
107 107
 		}
108 108
 	}
109 109
 
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
 					return $this->makeNode($tag);
121 121
 				}
122 122
 			}
123
-			throw new NotFound('Tag with id ' . $tagId . ' not present for object ' . $this->objectId);
123
+			throw new NotFound('Tag with id '.$tagId.' not present for object '.$this->objectId);
124 124
 		} catch (\InvalidArgumentException $e) {
125 125
 			throw new BadRequest('Invalid tag id', 0, $e);
126 126
 		} catch (TagNotFoundException $e) {
127
-			throw new NotFound('Tag with id ' . $tagId . ' not found', 0, $e);
127
+			throw new NotFound('Tag with id '.$tagId.' not found', 0, $e);
128 128
 		}
129 129
 	}
130 130
 
Please login to merge, or discard this patch.
apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,6 @@
 block discarded – undo
26 26
 use Sabre\DAV\Exception\MethodNotAllowed;
27 27
 use Sabre\DAV\Exception\NotFound;
28 28
 use Sabre\DAV\ICollection;
29
-
30 29
 use OCP\SystemTag\ISystemTagManager;
31 30
 use OCP\SystemTag\ISystemTagObjectMapper;
32 31
 use OCP\IUserSession;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
120 120
 	 */
121 121
 	function getChild($objectId) {
122 122
 		// make sure the object exists and is reachable
123
-		if(!$this->childExists($objectId)) {
123
+		if (!$this->childExists($objectId)) {
124 124
 			throw new NotFound('Entity does not exist or is not available');
125 125
 		}
126 126
 		return new SystemTagsObjectMappingCollection(
Please login to merge, or discard this patch.