@@ -23,7 +23,7 @@ |
||
23 | 23 | * @see https://tools.ietf.org/html/rfc6578 for sync-token |
24 | 24 | * GetCalendarRequest constructor. |
25 | 25 | */ |
26 | - public function __construct(){ |
|
26 | + public function __construct() { |
|
27 | 27 | $this->properties = [ |
28 | 28 | '{DAV:}displayname', |
29 | 29 | '{DAV:}resourcetype', |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | const EventCreateRequestType = 'CREATE_EVENT'; |
30 | 30 | const EventUpdateRequestType = 'UPDATE_EVENT'; |
31 | 31 | |
32 | - private function __construct(){} |
|
32 | + private function __construct() {} |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * @var CalDAVRequestFactory |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * @return CalDAVRequestFactory |
41 | 41 | */ |
42 | - public static function getInstance(){ |
|
43 | - if(is_null(self::$instance)) self::$instance = new CalDAVRequestFactory(); |
|
42 | + public static function getInstance() { |
|
43 | + if (is_null(self::$instance)) self::$instance = new CalDAVRequestFactory(); |
|
44 | 44 | return self::$instance; |
45 | 45 | } |
46 | 46 | |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | * @return IAbstractWebDAVRequest|null |
51 | 51 | * @throws \InvalidArgumentException |
52 | 52 | */ |
53 | - public function build($type, $params = []){ |
|
54 | - switch(strtoupper($type)){ |
|
53 | + public function build($type, $params = []) { |
|
54 | + switch (strtoupper($type)) { |
|
55 | 55 | case self::PrincipalRequestType: |
56 | 56 | return new UserPrincipalRequest(); |
57 | 57 | case self::CalendarHomeRequestType: |
@@ -61,27 +61,27 @@ discard block |
||
61 | 61 | case self::CalendarRequestType: |
62 | 62 | return new GetCalendarRequest(); |
63 | 63 | case self::CalendarSyncRequestType: |
64 | - if(count($params) == 0 ) |
|
64 | + if (count($params) == 0) |
|
65 | 65 | throw new \InvalidArgumentException(); |
66 | 66 | return new CalendarSyncRequest($params[0]); |
67 | 67 | case self::CalendarMultiGetRequestType: |
68 | - if(count($params) == 0 ) |
|
68 | + if (count($params) == 0) |
|
69 | 69 | throw new \InvalidArgumentException(); |
70 | 70 | return new CalendarMultiGetRequest($params[0]); |
71 | 71 | case self::CalendarQueryRequestType: |
72 | - if(count($params) == 0 ) |
|
72 | + if (count($params) == 0) |
|
73 | 73 | throw new \InvalidArgumentException(); |
74 | 74 | return new CalendarQueryRequest($params[0]); |
75 | 75 | case self::CalendarCreateRequestType: |
76 | - if(count($params) == 0 ) |
|
76 | + if (count($params) == 0) |
|
77 | 77 | throw new \InvalidArgumentException(); |
78 | 78 | return new CalendarCreateRequest($params[0]); |
79 | 79 | case self::EventCreateRequestType: |
80 | - if(count($params) == 0 ) |
|
80 | + if (count($params) == 0) |
|
81 | 81 | throw new \InvalidArgumentException(); |
82 | 82 | return new EventCreateRequest($params[0]); |
83 | 83 | case self::EventUpdateRequestType: |
84 | - if(count($params) == 0 ) |
|
84 | + if (count($params) == 0) |
|
85 | 85 | throw new \InvalidArgumentException(); |
86 | 86 | return new EventUpdateRequest($params[0]); |
87 | 87 | } |
@@ -40,7 +40,9 @@ discard block |
||
40 | 40 | * @return CalDAVRequestFactory |
41 | 41 | */ |
42 | 42 | public static function getInstance(){ |
43 | - if(is_null(self::$instance)) self::$instance = new CalDAVRequestFactory(); |
|
43 | + if(is_null(self::$instance)) { |
|
44 | + self::$instance = new CalDAVRequestFactory(); |
|
45 | + } |
|
44 | 46 | return self::$instance; |
45 | 47 | } |
46 | 48 | |
@@ -61,28 +63,34 @@ discard block |
||
61 | 63 | case self::CalendarRequestType: |
62 | 64 | return new GetCalendarRequest(); |
63 | 65 | case self::CalendarSyncRequestType: |
64 | - if(count($params) == 0 ) |
|
65 | - throw new \InvalidArgumentException(); |
|
66 | + if(count($params) == 0 ) { |
|
67 | + throw new \InvalidArgumentException(); |
|
68 | + } |
|
66 | 69 | return new CalendarSyncRequest($params[0]); |
67 | 70 | case self::CalendarMultiGetRequestType: |
68 | - if(count($params) == 0 ) |
|
69 | - throw new \InvalidArgumentException(); |
|
71 | + if(count($params) == 0 ) { |
|
72 | + throw new \InvalidArgumentException(); |
|
73 | + } |
|
70 | 74 | return new CalendarMultiGetRequest($params[0]); |
71 | 75 | case self::CalendarQueryRequestType: |
72 | - if(count($params) == 0 ) |
|
73 | - throw new \InvalidArgumentException(); |
|
76 | + if(count($params) == 0 ) { |
|
77 | + throw new \InvalidArgumentException(); |
|
78 | + } |
|
74 | 79 | return new CalendarQueryRequest($params[0]); |
75 | 80 | case self::CalendarCreateRequestType: |
76 | - if(count($params) == 0 ) |
|
77 | - throw new \InvalidArgumentException(); |
|
81 | + if(count($params) == 0 ) { |
|
82 | + throw new \InvalidArgumentException(); |
|
83 | + } |
|
78 | 84 | return new CalendarCreateRequest($params[0]); |
79 | 85 | case self::EventCreateRequestType: |
80 | - if(count($params) == 0 ) |
|
81 | - throw new \InvalidArgumentException(); |
|
86 | + if(count($params) == 0 ) { |
|
87 | + throw new \InvalidArgumentException(); |
|
88 | + } |
|
82 | 89 | return new EventCreateRequest($params[0]); |
83 | 90 | case self::EventUpdateRequestType: |
84 | - if(count($params) == 0 ) |
|
85 | - throw new \InvalidArgumentException(); |
|
91 | + if(count($params) == 0 ) { |
|
92 | + throw new \InvalidArgumentException(); |
|
93 | + } |
|
86 | 94 | return new EventUpdateRequest($params[0]); |
87 | 95 | } |
88 | 96 | return null; |
@@ -36,8 +36,8 @@ |
||
36 | 36 | ]; |
37 | 37 | |
38 | 38 | $elements = []; |
39 | - foreach( $this->properties as $val ) { |
|
40 | - $elements[] = [ $val => ""]; |
|
39 | + foreach ($this->properties as $val) { |
|
40 | + $elements[] = [$val => ""]; |
|
41 | 41 | } |
42 | 42 | return $service->write('{DAV:}propfind', |
43 | 43 | [ |
@@ -46,8 +46,8 @@ |
||
46 | 46 | /** |
47 | 47 | * As indicated in Section 3.10 of [RFC2445], the URL of calendar object |
48 | 48 | * resources containing (an arbitrary set of) calendaring and scheduling |
49 | - * information may be suffixed by ".ics", and the URL of calendar object |
|
50 | - * resources containing free or busy time information may be suffixed by |
|
49 | + * information may be suffixed by ".ics", and the URL of calendar object |
|
50 | + * resources containing free or busy time information may be suffixed by |
|
51 | 51 | ".ifb". |
52 | 52 | */ |
53 | 53 |
@@ -124,15 +124,15 @@ discard block |
||
124 | 124 | * @param Request $http_request |
125 | 125 | * @return mixed|\Psr\Http\Message\ResponseInterface |
126 | 126 | */ |
127 | - private function makeRequest(Request $http_request){ |
|
128 | - try{ |
|
127 | + private function makeRequest(Request $http_request) { |
|
128 | + try { |
|
129 | 129 | return $this->client->send($http_request, [ |
130 | 130 | 'auth' => [$this->user, $this->password], |
131 | 131 | 'timeout' => $this->timeout |
132 | 132 | ]); |
133 | 133 | } |
134 | - catch (ClientException $ex){ |
|
135 | - switch($ex->getCode()){ |
|
134 | + catch (ClientException $ex) { |
|
135 | + switch ($ex->getCode()) { |
|
136 | 136 | case 401: |
137 | 137 | throw new UserUnAuthorizedException(); |
138 | 138 | break; |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | |
161 | 161 | $res = $http_response->hasHeader(self::DAVHeader); |
162 | 162 | $options = []; |
163 | - if($res){ |
|
163 | + if ($res) { |
|
164 | 164 | $val = $http_response->getHeaderLine(self::DAVHeader); |
165 | - if(!empty($val)){ |
|
165 | + if (!empty($val)) { |
|
166 | 166 | $options = explode(', ', $val); |
167 | 167 | } |
168 | 168 | } |
@@ -176,14 +176,13 @@ discard block |
||
176 | 176 | function getUserPrincipal() |
177 | 177 | { |
178 | 178 | $http_response = $this->makeRequest( |
179 | - RequestFactory::createPropFindRequest |
|
180 | - ( |
|
179 | + RequestFactory::createPropFindRequest( |
|
181 | 180 | $this->server_url, |
182 | 181 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::PrincipalRequestType)->getContent() |
183 | 182 | ) |
184 | 183 | ); |
185 | 184 | |
186 | - return new UserPrincipalResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
185 | + return new UserPrincipalResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode()); |
|
187 | 186 | } |
188 | 187 | |
189 | 188 | /** |
@@ -193,14 +192,13 @@ discard block |
||
193 | 192 | function getCalendarHome($principal_url) |
194 | 193 | { |
195 | 194 | $http_response = $this->makeRequest( |
196 | - RequestFactory::createPropFindRequest |
|
197 | - ( |
|
195 | + RequestFactory::createPropFindRequest( |
|
198 | 196 | $principal_url, |
199 | 197 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarHomeRequestType)->getContent() |
200 | 198 | ) |
201 | 199 | ); |
202 | 200 | |
203 | - return new CalendarHomesResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
201 | + return new CalendarHomesResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode()); |
|
204 | 202 | } |
205 | 203 | |
206 | 204 | /** |
@@ -212,8 +210,7 @@ discard block |
||
212 | 210 | function createCalendar($calendar_home_set, MakeCalendarRequestDTO $dto) |
213 | 211 | { |
214 | 212 | $http_response = $this->makeRequest( |
215 | - RequestFactory::createMakeCalendarRequest |
|
216 | - ( |
|
213 | + RequestFactory::createMakeCalendarRequest( |
|
217 | 214 | $calendar_home_set.$dto->getResourceName(), |
218 | 215 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarCreateRequestType, [$dto])->getContent() |
219 | 216 | ) |
@@ -229,14 +226,13 @@ discard block |
||
229 | 226 | function getCalendars($calendar_home_set_url) |
230 | 227 | { |
231 | 228 | $http_response = $this->makeRequest( |
232 | - RequestFactory::createPropFindRequest |
|
233 | - ( |
|
229 | + RequestFactory::createPropFindRequest( |
|
234 | 230 | $calendar_home_set_url, |
235 | 231 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarsRequestType)->getContent() |
236 | 232 | ) |
237 | 233 | ); |
238 | 234 | |
239 | - return new GetCalendarsResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
235 | + return new GetCalendarsResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode()); |
|
240 | 236 | } |
241 | 237 | |
242 | 238 | /** |
@@ -246,15 +242,14 @@ discard block |
||
246 | 242 | function getCalendar($calendar_url) |
247 | 243 | { |
248 | 244 | $http_response = $this->makeRequest( |
249 | - RequestFactory::createPropFindRequest |
|
250 | - ( |
|
245 | + RequestFactory::createPropFindRequest( |
|
251 | 246 | $calendar_url, |
252 | 247 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarRequestType)->getContent(), |
253 | 248 | 0 |
254 | 249 | ) |
255 | 250 | ); |
256 | 251 | |
257 | - return new GetCalendarResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
252 | + return new GetCalendarResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode()); |
|
258 | 253 | } |
259 | 254 | |
260 | 255 | |
@@ -267,14 +262,13 @@ discard block |
||
267 | 262 | { |
268 | 263 | |
269 | 264 | $http_response = $this->makeRequest( |
270 | - RequestFactory::createReportRequest |
|
271 | - ( |
|
265 | + RequestFactory::createReportRequest( |
|
272 | 266 | $calendar_url, |
273 | 267 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarSyncRequestType, [$sync_token])->getContent() |
274 | 268 | ) |
275 | 269 | ); |
276 | 270 | |
277 | - return new CalendarSyncInfoResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
271 | + return new CalendarSyncInfoResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode()); |
|
278 | 272 | } |
279 | 273 | |
280 | 274 | /** |
@@ -287,19 +281,17 @@ discard block |
||
287 | 281 | $uid = $dto->getUID(); |
288 | 282 | $resource_url = $calendar_url.$uid.self::SchedulingInformationSuffix; |
289 | 283 | $http_response = $this->makeRequest( |
290 | - RequestFactory::createPutRequest |
|
291 | - ( |
|
284 | + RequestFactory::createPutRequest( |
|
292 | 285 | $resource_url, |
293 | 286 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::EventCreateRequestType, [$dto])->getContent() |
294 | 287 | ) |
295 | 288 | ); |
296 | 289 | $etag = $http_response->hasHeader(self::ETagHeader) ? $http_response->getHeaderLine(self::ETagHeader) : null; |
297 | - return new EventCreatedResponse |
|
298 | - ( |
|
290 | + return new EventCreatedResponse( |
|
299 | 291 | $uid, |
300 | 292 | $etag, |
301 | 293 | $resource_url, |
302 | - (string)$http_response->getBody(), |
|
294 | + (string) $http_response->getBody(), |
|
303 | 295 | $http_response->getStatusCode() |
304 | 296 | ); |
305 | 297 | } |
@@ -315,20 +307,18 @@ discard block |
||
315 | 307 | $uid = $dto->getUID(); |
316 | 308 | $resource_url = $calendar_url.$uid.self::SchedulingInformationSuffix; |
317 | 309 | $http_response = $this->makeRequest( |
318 | - RequestFactory::createPutRequest |
|
319 | - ( |
|
310 | + RequestFactory::createPutRequest( |
|
320 | 311 | $resource_url, |
321 | 312 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::EventUpdateRequestType, [$dto])->getContent(), |
322 | 313 | $etag |
323 | 314 | ) |
324 | 315 | ); |
325 | 316 | $etag = $http_response->hasHeader(self::ETagHeader) ? $http_response->getHeaderLine(self::ETagHeader) : null; |
326 | - return new EventUpdatedResponse |
|
327 | - ( |
|
317 | + return new EventUpdatedResponse( |
|
328 | 318 | $uid, |
329 | 319 | $etag, |
330 | 320 | $resource_url, |
331 | - (string)$http_response->getBody(), |
|
321 | + (string) $http_response->getBody(), |
|
332 | 322 | $http_response->getStatusCode() |
333 | 323 | ); |
334 | 324 | } |
@@ -342,16 +332,14 @@ discard block |
||
342 | 332 | function deleteEvent($calendar_url, $uid, $etag) |
343 | 333 | { |
344 | 334 | $http_response = $this->makeRequest( |
345 | - RequestFactory::createDeleteRequest |
|
346 | - ( |
|
335 | + RequestFactory::createDeleteRequest( |
|
347 | 336 | $calendar_url.$uid.self::SchedulingInformationSuffix, |
348 | 337 | $etag |
349 | 338 | ) |
350 | 339 | ); |
351 | 340 | |
352 | - return new EventDeletedResponse |
|
353 | - ( |
|
354 | - $this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode() |
|
341 | + return new EventDeletedResponse( |
|
342 | + $this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode() |
|
355 | 343 | ); |
356 | 344 | } |
357 | 345 | |
@@ -359,15 +347,14 @@ discard block |
||
359 | 347 | * @param string $event_url |
360 | 348 | * @return string |
361 | 349 | */ |
362 | - function getEventVCardBy($event_url){ |
|
350 | + function getEventVCardBy($event_url) { |
|
363 | 351 | $http_response = $this->makeRequest( |
364 | - RequestFactory::createGetRequest |
|
365 | - ( |
|
352 | + RequestFactory::createGetRequest( |
|
366 | 353 | $event_url |
367 | 354 | ) |
368 | 355 | ); |
369 | 356 | |
370 | - $ical = (string)$http_response->getBody(); |
|
357 | + $ical = (string) $http_response->getBody(); |
|
371 | 358 | return $ical; |
372 | 359 | } |
373 | 360 | |
@@ -379,17 +366,15 @@ discard block |
||
379 | 366 | function getEventsBy($calendar_url, array $events_urls) |
380 | 367 | { |
381 | 368 | $http_response = $this->makeRequest( |
382 | - RequestFactory::createReportRequest |
|
383 | - ( |
|
369 | + RequestFactory::createReportRequest( |
|
384 | 370 | $calendar_url, |
385 | 371 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarMultiGetRequestType, [$events_urls])->getContent() |
386 | 372 | ) |
387 | 373 | ); |
388 | 374 | |
389 | - return new ResourceCollectionResponse |
|
390 | - ( |
|
375 | + return new ResourceCollectionResponse( |
|
391 | 376 | $this->server_url, |
392 | - (string)$http_response->getBody(), |
|
377 | + (string) $http_response->getBody(), |
|
393 | 378 | $http_response->getStatusCode() |
394 | 379 | ); |
395 | 380 | } |
@@ -403,17 +388,15 @@ discard block |
||
403 | 388 | { |
404 | 389 | |
405 | 390 | $http_response = $this->makeRequest( |
406 | - RequestFactory::createReportRequest |
|
407 | - ( |
|
391 | + RequestFactory::createReportRequest( |
|
408 | 392 | $calendar_url, |
409 | 393 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarQueryRequestType, [$filter])->getContent() |
410 | 394 | ) |
411 | 395 | ); |
412 | 396 | |
413 | - return new ResourceCollectionResponse |
|
414 | - ( |
|
397 | + return new ResourceCollectionResponse( |
|
415 | 398 | $this->server_url, |
416 | - (string)$http_response->getBody(), |
|
399 | + (string) $http_response->getBody(), |
|
417 | 400 | $http_response->getStatusCode() |
418 | 401 | ); |
419 | 402 | } |
@@ -130,8 +130,7 @@ |
||
130 | 130 | 'auth' => [$this->user, $this->password], |
131 | 131 | 'timeout' => $this->timeout |
132 | 132 | ]); |
133 | - } |
|
134 | - catch (ClientException $ex){ |
|
133 | + } catch (ClientException $ex){ |
|
135 | 134 | switch($ex->getCode()){ |
136 | 135 | case 401: |
137 | 136 | throw new UserUnAuthorizedException(); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | /** |
22 | 22 | * @return bool |
23 | 23 | */ |
24 | - public function isSuccessFull(){ |
|
24 | + public function isSuccessFull() { |
|
25 | 25 | return $this->code == HttpResponse::HttpCodeNoContent; |
26 | 26 | } |
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -67,14 +67,14 @@ |
||
67 | 67 | /** |
68 | 68 | * @return string |
69 | 69 | */ |
70 | - public function getResourceUrl(){ |
|
70 | + public function getResourceUrl() { |
|
71 | 71 | return $this->resource_url; |
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
75 | 75 | * @return bool |
76 | 76 | */ |
77 | - public function isSuccessFull(){ |
|
77 | + public function isSuccessFull() { |
|
78 | 78 | return $this->code == HttpResponse::HttpCodeCreated; |
79 | 79 | } |
80 | 80 | } |
81 | 81 | \ No newline at end of file |
@@ -21,7 +21,7 @@ |
||
21 | 21 | /** |
22 | 22 | * @return string |
23 | 23 | */ |
24 | - public function getETag(){ |
|
24 | + public function getETag() { |
|
25 | 25 | return isset($this->found_props['getetag']) ? $this->found_props['getetag'] : null; |
26 | 26 | } |
27 | 27 |
@@ -22,14 +22,14 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * @return string|null |
24 | 24 | */ |
25 | - function getSyncToken(){ |
|
26 | - return isset($this->content['sync-token'])? $this->content['sync-token'] : null; |
|
25 | + function getSyncToken() { |
|
26 | + return isset($this->content['sync-token']) ? $this->content['sync-token'] : null; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @return bool |
31 | 31 | */ |
32 | - function hasAvailableChanges(){ |
|
32 | + function hasAvailableChanges() { |
|
33 | 33 | return count($this->responses) > 0; |
34 | 34 | } |
35 | 35 | |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * @return ETagEntityResponse[] |
39 | 39 | */ |
40 | - function getUpdates(){ |
|
40 | + function getUpdates() { |
|
41 | 41 | $res = []; |
42 | - foreach ($this->responses as $entity){ |
|
43 | - if($entity->getStatus() != HttpResponse::HttpOKStatus) continue; |
|
42 | + foreach ($this->responses as $entity) { |
|
43 | + if ($entity->getStatus() != HttpResponse::HttpOKStatus) continue; |
|
44 | 44 | $res[] = $entity; |
45 | 45 | } |
46 | 46 | return $res; |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | /** |
50 | 50 | * @return ETagEntityResponse[] |
51 | 51 | */ |
52 | - function getDeletes(){ |
|
52 | + function getDeletes() { |
|
53 | 53 | $res = []; |
54 | - foreach ($this->responses as $entity){ |
|
55 | - if($entity->getStatus() != HttpResponse::HttpNotFoundStatus) continue; |
|
54 | + foreach ($this->responses as $entity) { |
|
55 | + if ($entity->getStatus() != HttpResponse::HttpNotFoundStatus) continue; |
|
56 | 56 | $res[] = $entity; |
57 | 57 | } |
58 | 58 | return $res; |
@@ -40,7 +40,9 @@ discard block |
||
40 | 40 | function getUpdates(){ |
41 | 41 | $res = []; |
42 | 42 | foreach ($this->responses as $entity){ |
43 | - if($entity->getStatus() != HttpResponse::HttpOKStatus) continue; |
|
43 | + if($entity->getStatus() != HttpResponse::HttpOKStatus) { |
|
44 | + continue; |
|
45 | + } |
|
44 | 46 | $res[] = $entity; |
45 | 47 | } |
46 | 48 | return $res; |
@@ -52,7 +54,9 @@ discard block |
||
52 | 54 | function getDeletes(){ |
53 | 55 | $res = []; |
54 | 56 | foreach ($this->responses as $entity){ |
55 | - if($entity->getStatus() != HttpResponse::HttpNotFoundStatus) continue; |
|
57 | + if($entity->getStatus() != HttpResponse::HttpNotFoundStatus) { |
|
58 | + continue; |
|
59 | + } |
|
56 | 60 | $res[] = $entity; |
57 | 61 | } |
58 | 62 | return $res; |
@@ -21,8 +21,8 @@ |
||
21 | 21 | /** |
22 | 22 | * @return string |
23 | 23 | */ |
24 | - public function getPrincipalUrl(){ |
|
25 | - return isset($this->found_props['current-user-principal']) && isset($this->found_props['current-user-principal']['href']) ? |
|
24 | + public function getPrincipalUrl() { |
|
25 | + return isset($this->found_props['current-user-principal']) && isset($this->found_props['current-user-principal']['href']) ? |
|
26 | 26 | $this->server_url.$this->found_props['current-user-principal']['href'] : null; |
27 | 27 | } |
28 | 28 | } |
29 | 29 | \ No newline at end of file |