@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @return string |
91 | 91 | */ |
92 | - public function getPluginName() { |
|
92 | + public function getPluginName() { |
|
93 | 93 | return 'oc-calendar-publishing'; |
94 | 94 | } |
95 | 95 | |
@@ -107,12 +107,12 @@ discard block |
||
107 | 107 | $this->server = $server; |
108 | 108 | |
109 | 109 | $this->server->on('method:POST', [$this, 'httpPost']); |
110 | - $this->server->on('propFind', [$this, 'propFind']); |
|
110 | + $this->server->on('propFind', [$this, 'propFind']); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | public function propFind(PropFind $propFind, INode $node) { |
114 | 114 | if ($node instanceof Calendar) { |
115 | - $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node) { |
|
115 | + $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function() use ($node) { |
|
116 | 116 | if ($node->getPublishStatus()) { |
117 | 117 | // We return the publish-url only if the calendar is published. |
118 | 118 | $token = $node->getPublishStatus(); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if ($ex->getCode() === Http::STATUS_UNAUTHORIZED) { |
91 | 91 | // remote server revoked access to the address book, remove it |
92 | 92 | $this->backend->deleteAddressBook($addressBookId); |
93 | - $this->logger->info('Authorization failed, remove address book: ' . $url, ['app' => 'dav']); |
|
93 | + $this->logger->info('Authorization failed, remove address book: '.$url, ['app' => 'dav']); |
|
94 | 94 | throw $ex; |
95 | 95 | } |
96 | 96 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | protected function requestSyncReport($url, $userName, $sharedSecret, $syncToken) { |
143 | 143 | $settings = [ |
144 | - 'baseUri' => $url . '/', |
|
144 | + 'baseUri' => $url.'/', |
|
145 | 145 | 'userName' => $userName, |
146 | 146 | 'password' => $sharedSecret, |
147 | 147 | ]; |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | */ |
255 | 255 | public function deleteUser($userOrCardId) { |
256 | 256 | $systemAddressBook = $this->getLocalSystemAddressBook(); |
257 | - if ($userOrCardId instanceof IUser){ |
|
257 | + if ($userOrCardId instanceof IUser) { |
|
258 | 258 | $name = $userOrCardId->getBackendClassName(); |
259 | 259 | $userId = $userOrCardId->getUID(); |
260 | 260 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | if (is_null($this->localSystemAddressBook)) { |
271 | 271 | $systemPrincipal = "principals/system/system"; |
272 | 272 | $this->localSystemAddressBook = $this->ensureSystemAddressBookExists($systemPrincipal, 'system', [ |
273 | - '{' . Plugin::NS_CARDDAV . '}addressbook-description' => 'System addressbook which holds all users of this instance' |
|
273 | + '{'.Plugin::NS_CARDDAV.'}addressbook-description' => 'System addressbook which holds all users of this instance' |
|
274 | 274 | ]); |
275 | 275 | } |
276 | 276 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | |
289 | 289 | // remove no longer existing |
290 | 290 | $allCards = $this->backend->getCards($systemAddressBook['id']); |
291 | - foreach($allCards as $card) { |
|
291 | + foreach ($allCards as $card) { |
|
292 | 292 | $vCard = Reader::read($card['carddata']); |
293 | 293 | $uid = $vCard->UID->getValue(); |
294 | 294 | // load backend and see if user exists |
@@ -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 | } |
@@ -45,15 +45,15 @@ discard block |
||
45 | 45 | |
46 | 46 | if (strrpos($principal, 'principals/users', -strlen($principal)) !== false) { |
47 | 47 | list(, $principalId) = URLUtil::splitPath($principal); |
48 | - return self::ADDRESSBOOK_ROOT . '/users/' . $principalId; |
|
48 | + return self::ADDRESSBOOK_ROOT.'/users/'.$principalId; |
|
49 | 49 | } |
50 | 50 | if (strrpos($principal, 'principals/groups', -strlen($principal)) !== false) { |
51 | 51 | list(, $principalId) = URLUtil::splitPath($principal); |
52 | - return self::ADDRESSBOOK_ROOT . '/groups/' . $principalId; |
|
52 | + return self::ADDRESSBOOK_ROOT.'/groups/'.$principalId; |
|
53 | 53 | } |
54 | 54 | if (strrpos($principal, 'principals/system', -strlen($principal)) !== false) { |
55 | 55 | list(, $principalId) = URLUtil::splitPath($principal); |
56 | - return self::ADDRESSBOOK_ROOT . '/system/' . $principalId; |
|
56 | + return self::ADDRESSBOOK_ROOT.'/system/'.$principalId; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | throw new \LogicException('This is not supposed to happen'); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | if ($node instanceof AddressBook) { |
74 | 74 | |
75 | - $propFind->handle($ns . 'groups', function () use ($node) { |
|
75 | + $propFind->handle($ns.'groups', function() use ($node) { |
|
76 | 76 | return new Groups($node->getContactsGroups()); |
77 | 77 | }); |
78 | 78 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | function getACL() { |
93 | - $acl = [ |
|
93 | + $acl = [ |
|
94 | 94 | [ |
95 | 95 | 'privilege' => '{DAV:}read', |
96 | 96 | 'principal' => $this->getOwner(), |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | 'protected' => true, |
103 | 103 | ]; |
104 | 104 | if ($this->getOwner() !== parent::getOwner()) { |
105 | - $acl[] = [ |
|
105 | + $acl[] = [ |
|
106 | 106 | 'privilege' => '{DAV:}read', |
107 | 107 | 'principal' => parent::getOwner(), |
108 | 108 | 'protected' => true, |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | function delete() { |
161 | 161 | if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) { |
162 | - $principal = 'principal:' . parent::getOwner(); |
|
162 | + $principal = 'principal:'.parent::getOwner(); |
|
163 | 163 | $shares = $this->getShares(); |
164 | 164 | $shares = array_filter($shares, function($share) use ($principal){ |
165 | 165 | return $share['href'] === $principal; |
@@ -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; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | 'image/gif', |
130 | 130 | ]; |
131 | 131 | |
132 | - if(!in_array($type, $allowedContentTypes, true)) { |
|
132 | + if (!in_array($type, $allowedContentTypes, true)) { |
|
133 | 133 | $type = 'application/octet-stream'; |
134 | 134 | } |
135 | 135 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | 'Content-Type' => $type, |
138 | 138 | 'body' => $val |
139 | 139 | ]; |
140 | - } catch(\Exception $ex) { |
|
140 | + } catch (\Exception $ex) { |
|
141 | 141 | $this->logger->logException($ex); |
142 | 142 | } |
143 | 143 | return false; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | if (strpos($type, 'image/') === 0) { |
162 | 162 | return $type; |
163 | 163 | } else { |
164 | - return 'image/' . strtolower($type); |
|
164 | + return 'image/'.strtolower($type); |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | return ''; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | break; |
72 | 72 | case AccountManager::PROPERTY_AVATAR: |
73 | 73 | if ($image !== null) { |
74 | - $vCard->add('PHOTO', 'data:'.$image->mimeType().';base64,' . base64_encode($image->data())); |
|
74 | + $vCard->add('PHOTO', 'data:'.$image->mimeType().';base64,'.base64_encode($image->data())); |
|
75 | 75 | } |
76 | 76 | break; |
77 | 77 | case AccountManager::PROPERTY_EMAIL: |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | $elements = explode(' ', $fullName); |
114 | 114 | $result = ['', '', '', '', '']; |
115 | 115 | if (count($elements) > 2) { |
116 | - $result[0] = implode(' ', array_slice($elements, count($elements)-1)); |
|
116 | + $result[0] = implode(' ', array_slice($elements, count($elements) - 1)); |
|
117 | 117 | $result[1] = $elements[0]; |
118 | - $result[2] = implode(' ', array_slice($elements, 1, count($elements)-2)); |
|
118 | + $result[2] = implode(' ', array_slice($elements, 1, count($elements) - 2)); |
|
119 | 119 | } elseif (count($elements) === 2) { |
120 | 120 | $result[0] = $elements[1]; |
121 | 121 | $result[1] = $elements[0]; |