@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $update = false; |
112 | 112 | if (!isset($properties['URI'])) { // create a new contact |
113 | 113 | $uid = $this->createUid(); |
114 | - $uri = $uid . '.vcf'; |
|
114 | + $uri = $uid.'.vcf'; |
|
115 | 115 | $vCard = $this->createEmptyVCard($uid); |
116 | 116 | } else { // update existing contact |
117 | 117 | $uri = $properties['URI']; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $permissions = $this->addressBook->getACL(); |
143 | 143 | $result = 0; |
144 | 144 | foreach ($permissions as $permission) { |
145 | - switch($permission['privilege']) { |
|
145 | + switch ($permission['privilege']) { |
|
146 | 146 | case '{DAV:}read': |
147 | 147 | $result |= Constants::PERMISSION_READ; |
148 | 148 | break; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | protected function createUid() { |
188 | 188 | do { |
189 | 189 | $uid = $this->getUid(); |
190 | - $contact = $this->backend->getContact($this->getKey(), $uid . '.vcf'); |
|
190 | + $contact = $this->backend->getContact($this->getKey(), $uid.'.vcf'); |
|
191 | 191 | } while (!empty($contact)); |
192 | 192 | |
193 | 193 | return $uid; |
@@ -227,15 +227,15 @@ discard block |
||
227 | 227 | foreach ($vCard->children() as $property) { |
228 | 228 | if ($property->name === 'PHOTO' && $property->getValueType() === 'BINARY') { |
229 | 229 | $url = $this->urlGenerator->getAbsoluteURL( |
230 | - $this->urlGenerator->linkTo('', 'remote.php') . '/dav/'); |
|
230 | + $this->urlGenerator->linkTo('', 'remote.php').'/dav/'); |
|
231 | 231 | $url .= implode('/', [ |
232 | 232 | 'addressbooks', |
233 | 233 | substr($this->addressBookInfo['principaluri'], 11), //cut off 'principals/' |
234 | 234 | $this->addressBookInfo['uri'], |
235 | 235 | $uri |
236 | - ]) . '?photo'; |
|
236 | + ]).'?photo'; |
|
237 | 237 | |
238 | - $result['PHOTO'] = 'VALUE=uri:' . $url; |
|
238 | + $result['PHOTO'] = 'VALUE=uri:'.$url; |
|
239 | 239 | |
240 | 240 | } else if ($property->name === 'X-SOCIALPROFILE') { |
241 | 241 | $type = $this->getTypeFromProperty($property); |
@@ -40,7 +40,7 @@ |
||
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 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | |
41 | 41 | $addressBooks = $this->carddavBackend->getAddressBooksForUser($this->principalUri); |
42 | 42 | $objects = []; |
43 | - foreach($addressBooks as $addressBook) { |
|
43 | + foreach ($addressBooks as $addressBook) { |
|
44 | 44 | $objects[] = new AddressBook($this->carddavBackend, $addressBook, $this->l10n); |
45 | 45 | } |
46 | 46 | return $objects; |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | public function update($name, $userVisible, $userAssignable) { |
121 | 121 | try { |
122 | 122 | if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
123 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' does not exist'); |
|
123 | + throw new NotFound('Tag with id '.$this->tag->getId().' does not exist'); |
|
124 | 124 | } |
125 | 125 | if (!$this->tagManager->canUserAssignTag($this->tag, $this->user)) { |
126 | - throw new Forbidden('No permission to update tag ' . $this->tag->getId()); |
|
126 | + throw new Forbidden('No permission to update tag '.$this->tag->getId()); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | // only admin is able to change permissions, regular users can only rename |
@@ -132,17 +132,17 @@ discard block |
||
132 | 132 | if ($userVisible !== $this->tag->isUserVisible() |
133 | 133 | || $userAssignable !== $this->tag->isUserAssignable() |
134 | 134 | ) { |
135 | - throw new Forbidden('No permission to update permissions for tag ' . $this->tag->getId()); |
|
135 | + throw new Forbidden('No permission to update permissions for tag '.$this->tag->getId()); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
139 | 139 | $this->tagManager->updateTag($this->tag->getId(), $name, $userVisible, $userAssignable); |
140 | 140 | } catch (TagNotFoundException $e) { |
141 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' does not exist'); |
|
141 | + throw new NotFound('Tag with id '.$this->tag->getId().' does not exist'); |
|
142 | 142 | } catch (TagAlreadyExistsException $e) { |
143 | 143 | throw new Conflict( |
144 | - 'Tag with the properties "' . $name . '", ' . |
|
145 | - $userVisible . ', ' . $userAssignable . ' already exists' |
|
144 | + 'Tag with the properties "'.$name.'", '. |
|
145 | + $userVisible.', '.$userAssignable.' already exists' |
|
146 | 146 | ); |
147 | 147 | } |
148 | 148 | } |
@@ -158,17 +158,17 @@ discard block |
||
158 | 158 | public function delete() { |
159 | 159 | try { |
160 | 160 | if (!$this->isAdmin) { |
161 | - throw new Forbidden('No permission to delete tag ' . $this->tag->getId()); |
|
161 | + throw new Forbidden('No permission to delete tag '.$this->tag->getId()); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
165 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found'); |
|
165 | + throw new NotFound('Tag with id '.$this->tag->getId().' not found'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | $this->tagManager->deleteTags($this->tag->getId()); |
169 | 169 | } catch (TagNotFoundException $e) { |
170 | 170 | // can happen if concurrent deletion occurred |
171 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found', 0, $e); |
|
171 | + throw new NotFound('Tag with id '.$this->tag->getId().' not found', 0, $e); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |
@@ -106,13 +106,13 @@ |
||
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 |
@@ -120,7 +120,7 @@ |
||
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( |
@@ -156,15 +156,15 @@ |
||
156 | 156 | public function delete() { |
157 | 157 | try { |
158 | 158 | if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) { |
159 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found'); |
|
159 | + throw new NotFound('Tag with id '.$this->tag->getId().' not found'); |
|
160 | 160 | } |
161 | 161 | if (!$this->tagManager->canUserAssignTag($this->tag, $this->user)) { |
162 | - throw new Forbidden('No permission to unassign tag ' . $this->tag->getId()); |
|
162 | + throw new Forbidden('No permission to unassign tag '.$this->tag->getId()); |
|
163 | 163 | } |
164 | 164 | $this->tagMapper->unassignTags($this->objectId, $this->objectType, $this->tag->getId()); |
165 | 165 | } catch (TagNotFoundException $e) { |
166 | 166 | // can happen if concurrent deletion occurred |
167 | - throw new NotFound('Tag with id ' . $this->tag->getId() . ' not found', 0, $e); |
|
167 | + throw new NotFound('Tag with id '.$this->tag->getId().' not found', 0, $e); |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | } |
@@ -135,7 +135,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -95,15 +95,15 @@ discard block |
||
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 |
||
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 |