@@ -76,7 +76,7 @@ |
||
76 | 76 | |
77 | 77 | public const FORMAT_NONE = -1; |
78 | 78 | public const FORMAT_STATUSES = -2; |
79 | - public const FORMAT_SOURCES = -3; // ToDo Check if it is still in use otherwise remove it |
|
79 | + public const FORMAT_SOURCES = -3; // ToDo Check if it is still in use otherwise remove it |
|
80 | 80 | |
81 | 81 | public const RESPONSE_FORMAT = 'json'; // default resonse format for ocs calls |
82 | 82 |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function initialize(Server $server) { |
103 | 103 | $this->server = $server; |
104 | - $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}share'] = ShareRequest::class; |
|
105 | - $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}invite'] = Invite::class; |
|
104 | + $this->server->xml->elementMap['{'.Plugin::NS_OWNCLOUD.'}share'] = ShareRequest::class; |
|
105 | + $this->server->xml->elementMap['{'.Plugin::NS_OWNCLOUD.'}invite'] = Invite::class; |
|
106 | 106 | |
107 | 107 | $this->server->on('method:POST', [$this, 'httpPost']); |
108 | - $this->server->on('propFind', [$this, 'propFind']); |
|
108 | + $this->server->on('propFind', [$this, 'propFind']); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | // Dealing with the 'share' document, which modified invitees on a |
150 | 150 | // calendar. |
151 | - case '{' . self::NS_OWNCLOUD . '}share': |
|
151 | + case '{'.self::NS_OWNCLOUD.'}share': |
|
152 | 152 | |
153 | 153 | // We can only deal with IShareableCalendar objects |
154 | 154 | if (!$node instanceof IShareable) { |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public function propFind(PropFind $propFind, INode $node) { |
192 | 192 | if ($node instanceof IShareable) { |
193 | - $propFind->handle('{' . Plugin::NS_OWNCLOUD . '}invite', function () use ($node) { |
|
193 | + $propFind->handle('{'.Plugin::NS_OWNCLOUD.'}invite', function() use ($node) { |
|
194 | 194 | return new Invite( |
195 | 195 | $node->getShares() |
196 | 196 | ); |
@@ -52,10 +52,10 @@ |
||
52 | 52 | */ |
53 | 53 | public function xmlSerialize(Writer $writer) { |
54 | 54 | foreach ($this->shares as $share) { |
55 | - $writer->startElement('{' . self::NS_NEXTCLOUD . '}sharee'); |
|
56 | - $writer->writeElement('{' . self::NS_NEXTCLOUD . '}id', $share->getSharedWith()); |
|
57 | - $writer->writeElement('{' . self::NS_NEXTCLOUD . '}display-name', $share->getSharedWithDisplayName()); |
|
58 | - $writer->writeElement('{' . self::NS_NEXTCLOUD . '}type', $share->getShareType()); |
|
55 | + $writer->startElement('{'.self::NS_NEXTCLOUD.'}sharee'); |
|
56 | + $writer->writeElement('{'.self::NS_NEXTCLOUD.'}id', $share->getSharedWith()); |
|
57 | + $writer->writeElement('{'.self::NS_NEXTCLOUD.'}display-name', $share->getSharedWithDisplayName()); |
|
58 | + $writer->writeElement('{'.self::NS_NEXTCLOUD.'}type', $share->getShareType()); |
|
59 | 59 | $writer->endElement(); |
60 | 60 | } |
61 | 61 | } |
@@ -61,9 +61,9 @@ |
||
61 | 61 | * @return false |
62 | 62 | */ |
63 | 63 | public function httpGet(RequestInterface $request, ResponseInterface $response) { |
64 | - $string = 'This is the WebDAV interface. It can only be accessed by ' . |
|
64 | + $string = 'This is the WebDAV interface. It can only be accessed by '. |
|
65 | 65 | 'WebDAV clients such as the Nextcloud desktop sync client.'; |
66 | - $stream = fopen('php://memory','r+'); |
|
66 | + $stream = fopen('php://memory', 'r+'); |
|
67 | 67 | fwrite($stream, $string); |
68 | 68 | rewind($stream); |
69 | 69 |
@@ -40,9 +40,9 @@ |
||
40 | 40 | public static function xmlDeserialize(Reader $reader) { |
41 | 41 | $value = $reader->parseInnerTree(); |
42 | 42 | if (!is_int($value) && !is_string($value)) { |
43 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}offset has illegal value'); |
|
43 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}offset has illegal value'); |
|
44 | 44 | } |
45 | 45 | |
46 | - return (int)$value; |
|
46 | + return (int) $value; |
|
47 | 47 | } |
48 | 48 | } |
@@ -40,9 +40,9 @@ |
||
40 | 40 | public static function xmlDeserialize(Reader $reader) { |
41 | 41 | $value = $reader->parseInnerTree(); |
42 | 42 | if (!is_int($value) && !is_string($value)) { |
43 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}limit has illegal value'); |
|
43 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}limit has illegal value'); |
|
44 | 44 | } |
45 | 45 | |
46 | - return (int)$value; |
|
46 | + return (int) $value; |
|
47 | 47 | } |
48 | 48 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | public function getSubscription(string $principalUri, string $uri) { |
168 | 168 | $subscriptions = array_values(array_filter( |
169 | 169 | $this->calDavBackend->getSubscriptionsForUser($principalUri), |
170 | - function ($sub) use ($uri) { |
|
170 | + function($sub) use ($uri) { |
|
171 | 171 | return $sub['uri'] === $uri; |
172 | 172 | } |
173 | 173 | )); |
@@ -193,12 +193,12 @@ discard block |
||
193 | 193 | $latestLocation = null; |
194 | 194 | |
195 | 195 | $handlerStack = HandlerStack::create(); |
196 | - $handlerStack->push(Middleware::mapRequest(function (RequestInterface $request) { |
|
196 | + $handlerStack->push(Middleware::mapRequest(function(RequestInterface $request) { |
|
197 | 197 | return $request |
198 | 198 | ->withHeader('Accept', 'text/calendar, application/calendar+json, application/calendar+xml') |
199 | 199 | ->withHeader('User-Agent', 'Nextcloud Webcal Crawler'); |
200 | 200 | })); |
201 | - $handlerStack->push(Middleware::mapResponse(function (ResponseInterface $response) use (&$didBreak301Chain, &$latestLocation) { |
|
201 | + $handlerStack->push(Middleware::mapResponse(function(ResponseInterface $response) use (&$didBreak301Chain, &$latestLocation) { |
|
202 | 202 | if (!$didBreak301Chain) { |
203 | 203 | if ($response->getStatusCode() !== 301) { |
204 | 204 | $didBreak301Chain = true; |
@@ -372,10 +372,10 @@ discard block |
||
372 | 372 | } |
373 | 373 | |
374 | 374 | $host = $parsed['host'] ?? ''; |
375 | - $port = isset($parsed['port']) ? ':' . $parsed['port'] : ''; |
|
375 | + $port = isset($parsed['port']) ? ':'.$parsed['port'] : ''; |
|
376 | 376 | $path = $parsed['path'] ?? ''; |
377 | - $query = isset($parsed['query']) ? '?' . $parsed['query'] : ''; |
|
378 | - $fragment = isset($parsed['fragment']) ? '#' . $parsed['fragment'] : ''; |
|
377 | + $query = isset($parsed['query']) ? '?'.$parsed['query'] : ''; |
|
378 | + $fragment = isset($parsed['fragment']) ? '#'.$parsed['fragment'] : ''; |
|
379 | 379 | |
380 | 380 | $cleanURL = "$scheme://$host$port$path$query$fragment"; |
381 | 381 | // parse_url is giving some weird results if no url and no :// is given, |
@@ -394,6 +394,6 @@ discard block |
||
394 | 394 | * @return string |
395 | 395 | */ |
396 | 396 | public function getRandomCalendarObjectUri():string { |
397 | - return UUIDUtil::getUUID() . '.ics'; |
|
397 | + return UUIDUtil::getUUID().'.ics'; |
|
398 | 398 | } |
399 | 399 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $update = false; |
136 | 136 | if (!isset($properties['URI'])) { // create a new contact |
137 | 137 | $uid = $this->createUid(); |
138 | - $uri = $uid . '.vcf'; |
|
138 | + $uri = $uid.'.vcf'; |
|
139 | 139 | $vCard = $this->createEmptyVCard($uid); |
140 | 140 | } else { // update existing contact |
141 | 141 | $uri = $properties['URI']; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | protected function createUid() { |
211 | 211 | do { |
212 | 212 | $uid = $this->getUid(); |
213 | - $contact = $this->backend->getContact($this->getKey(), $uid . '.vcf'); |
|
213 | + $contact = $this->backend->getContact($this->getKey(), $uid.'.vcf'); |
|
214 | 214 | } while (!empty($contact)); |
215 | 215 | |
216 | 216 | return $uid; |
@@ -251,15 +251,15 @@ discard block |
||
251 | 251 | foreach ($vCard->children() as $property) { |
252 | 252 | if ($property->name === 'PHOTO' && $property->getValueType() === 'BINARY') { |
253 | 253 | $url = $this->urlGenerator->getAbsoluteURL( |
254 | - $this->urlGenerator->linkTo('', 'remote.php') . '/dav/'); |
|
254 | + $this->urlGenerator->linkTo('', 'remote.php').'/dav/'); |
|
255 | 255 | $url .= implode('/', [ |
256 | 256 | 'addressbooks', |
257 | 257 | substr($this->addressBookInfo['principaluri'], 11), //cut off 'principals/' |
258 | 258 | $this->addressBookInfo['uri'], |
259 | 259 | $uri |
260 | - ]) . '?photo'; |
|
260 | + ]).'?photo'; |
|
261 | 261 | |
262 | - $result['PHOTO'] = 'VALUE=uri:' . $url; |
|
262 | + $result['PHOTO'] = 'VALUE=uri:'.$url; |
|
263 | 263 | } elseif (in_array($property->name, ['URL', 'GEO', 'CLOUD', 'ADR', 'EMAIL', 'IMPP', 'TEL', 'X-SOCIALPROFILE', 'RELATED', 'LANG', 'X-ADDRESSBOOKSERVER-MEMBER'])) { |
264 | 264 | if (!isset($result[$property->name])) { |
265 | 265 | $result[$property->name] = []; |
@@ -60,7 +60,7 @@ |
||
60 | 60 | $ns = '{http://nextcloud.com/ns}'; |
61 | 61 | |
62 | 62 | if ($node instanceof Card) { |
63 | - $propFind->handle($ns . 'has-photo', function () use ($node) { |
|
63 | + $propFind->handle($ns.'has-photo', function() use ($node) { |
|
64 | 64 | $vcard = Reader::read($node->get()); |
65 | 65 | return $vcard instanceof VCard |
66 | 66 | && $vcard->PHOTO |