@@ -60,8 +60,7 @@ |
||
| 60 | 60 | if($time_zone->getName() == 'UTC'){ |
| 61 | 61 | $event->setUseUtc(true) |
| 62 | 62 | ->setUseTimezone(false); |
| 63 | - } |
|
| 64 | - else{ |
|
| 63 | + } else{ |
|
| 65 | 64 | $event->setUseUtc(false) |
| 66 | 65 | ->setUseTimezone(true); |
| 67 | 66 | } |
@@ -57,16 +57,16 @@ |
||
| 57 | 57 | ->setDescription(strip_tags($this->vo->getDescription())) |
| 58 | 58 | ->setDescriptionHTML($this->vo->getDescription()); |
| 59 | 59 | |
| 60 | - if($time_zone->getName() == 'UTC'){ |
|
| 60 | + if ($time_zone->getName() == 'UTC') { |
|
| 61 | 61 | $event->setUseUtc(true) |
| 62 | 62 | ->setUseTimezone(false); |
| 63 | 63 | } |
| 64 | - else{ |
|
| 64 | + else { |
|
| 65 | 65 | $event->setUseUtc(false) |
| 66 | 66 | ->setUseTimezone(true); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - if(!empty($this->vo->getLocationTitle())){ |
|
| 69 | + if (!empty($this->vo->getLocationTitle())) { |
|
| 70 | 70 | $geo = sprintf("%s;%s", $this->vo->getLocationLat(), $this->vo->getLocationLng()); |
| 71 | 71 | $event->setLocation($this->vo->getLocationTitle(), $this->vo->getLocationTitle(), $geo); |
| 72 | 72 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | final class UserPrincipalRequest extends AbstractPropFindWebDAVRequest |
| 20 | 20 | { |
| 21 | 21 | |
| 22 | - public function __construct(){ |
|
| 22 | + public function __construct() { |
|
| 23 | 23 | $this->properties = [ |
| 24 | 24 | '{DAV:}current-user-principal' |
| 25 | 25 | ]; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * CalendarMultiGetRequest constructor. |
| 29 | 29 | * @param array $hrefs |
| 30 | 30 | */ |
| 31 | - public function __construct(array $hrefs){ |
|
| 31 | + public function __construct(array $hrefs) { |
|
| 32 | 32 | $this->hrefs = $hrefs; |
| 33 | 33 | } |
| 34 | 34 | |
@@ -43,14 +43,14 @@ discard block |
||
| 43 | 43 | 'DAV:' => 'D', |
| 44 | 44 | 'urn:ietf:params:xml:ns:caldav' => 'C', |
| 45 | 45 | ]; |
| 46 | - $nodes = [ |
|
| 46 | + $nodes = [ |
|
| 47 | 47 | '{DAV:}prop' => [ |
| 48 | 48 | '{DAV:}getetag' => '', |
| 49 | 49 | '{urn:ietf:params:xml:ns:caldav}calendar-data' => '' |
| 50 | 50 | ], |
| 51 | 51 | ]; |
| 52 | 52 | // set hrefs |
| 53 | - foreach ($this->hrefs as $href){ |
|
| 53 | + foreach ($this->hrefs as $href) { |
|
| 54 | 54 | $nodes[] = ['name' => '{DAV:}href', 'value' => $href]; |
| 55 | 55 | } |
| 56 | 56 | return $service->write('{urn:ietf:params:xml:ns:caldav}calendar-multiget', $nodes); |
@@ -49,15 +49,15 @@ |
||
| 49 | 49 | $filter = []; |
| 50 | 50 | $props = []; |
| 51 | 51 | |
| 52 | - if($this->filter->useGetETags()){ |
|
| 52 | + if ($this->filter->useGetETags()) { |
|
| 53 | 53 | $props['{DAV:}getetag'] = ''; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - if($this->filter->useGetCalendarData()){ |
|
| 56 | + if ($this->filter->useGetCalendarData()) { |
|
| 57 | 57 | $props['{urn:ietf:params:xml:ns:caldav}calendar-data'] = ''; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - $nodes = [ |
|
| 60 | + $nodes = [ |
|
| 61 | 61 | '{DAV:}prop' => [ |
| 62 | 62 | $props |
| 63 | 63 | ], |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | final class GetCalendarsRequest extends AbstractPropFindWebDAVRequest |
| 19 | 19 | { |
| 20 | - public function __construct(){ |
|
| 20 | + public function __construct() { |
|
| 21 | 21 | $this->properties = [ |
| 22 | 22 | '{DAV:}resourcetype', |
| 23 | 23 | '{DAV:}displayname', |
@@ -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 | [ |
@@ -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(); |
@@ -125,15 +125,15 @@ discard block |
||
| 125 | 125 | * @param Request $http_request |
| 126 | 126 | * @return mixed|\Psr\Http\Message\ResponseInterface |
| 127 | 127 | */ |
| 128 | - private function makeRequest(Request $http_request){ |
|
| 129 | - try{ |
|
| 128 | + private function makeRequest(Request $http_request) { |
|
| 129 | + try { |
|
| 130 | 130 | return $this->client->send($http_request, [ |
| 131 | 131 | 'auth' => [$this->user, $this->password], |
| 132 | 132 | 'timeout' => $this->timeout |
| 133 | 133 | ]); |
| 134 | 134 | } |
| 135 | - catch (ClientException $ex){ |
|
| 136 | - switch($ex->getCode()){ |
|
| 135 | + catch (ClientException $ex) { |
|
| 136 | + switch ($ex->getCode()) { |
|
| 137 | 137 | case 401: |
| 138 | 138 | throw new UserUnAuthorizedException(); |
| 139 | 139 | break; |
@@ -161,9 +161,9 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | $res = $http_response->hasHeader(self::DAVHeader); |
| 163 | 163 | $options = []; |
| 164 | - if($res){ |
|
| 164 | + if ($res) { |
|
| 165 | 165 | $val = $http_response->getHeaderLine(self::DAVHeader); |
| 166 | - if(!empty($val)){ |
|
| 166 | + if (!empty($val)) { |
|
| 167 | 167 | $options = explode(', ', $val); |
| 168 | 168 | } |
| 169 | 169 | } |
@@ -177,14 +177,13 @@ discard block |
||
| 177 | 177 | public function getUserPrincipal() |
| 178 | 178 | { |
| 179 | 179 | $http_response = $this->makeRequest( |
| 180 | - RequestFactory::createPropFindRequest |
|
| 181 | - ( |
|
| 180 | + RequestFactory::createPropFindRequest( |
|
| 182 | 181 | $this->server_url, |
| 183 | 182 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::PrincipalRequestType)->getContent() |
| 184 | 183 | ) |
| 185 | 184 | ); |
| 186 | 185 | |
| 187 | - return new UserPrincipalResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
| 186 | + return new UserPrincipalResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode()); |
|
| 188 | 187 | } |
| 189 | 188 | |
| 190 | 189 | /** |
@@ -194,14 +193,13 @@ discard block |
||
| 194 | 193 | public function getCalendarHome($principal_url) |
| 195 | 194 | { |
| 196 | 195 | $http_response = $this->makeRequest( |
| 197 | - RequestFactory::createPropFindRequest |
|
| 198 | - ( |
|
| 196 | + RequestFactory::createPropFindRequest( |
|
| 199 | 197 | $principal_url, |
| 200 | 198 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarHomeRequestType)->getContent() |
| 201 | 199 | ) |
| 202 | 200 | ); |
| 203 | 201 | |
| 204 | - return new CalendarHomesResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
| 202 | + return new CalendarHomesResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode()); |
|
| 205 | 203 | } |
| 206 | 204 | |
| 207 | 205 | /** |
@@ -215,8 +213,7 @@ discard block |
||
| 215 | 213 | $uid = $vo->getUID(); |
| 216 | 214 | $resource_url = $calendar_home_set.$uid; |
| 217 | 215 | $http_response = $this->makeRequest( |
| 218 | - RequestFactory::createMakeCalendarRequest |
|
| 219 | - ( |
|
| 216 | + RequestFactory::createMakeCalendarRequest( |
|
| 220 | 217 | $resource_url, |
| 221 | 218 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarCreateRequestType, [$vo])->getContent() |
| 222 | 219 | ) |
@@ -232,14 +229,13 @@ discard block |
||
| 232 | 229 | public function getCalendars($calendar_home_set_url) |
| 233 | 230 | { |
| 234 | 231 | $http_response = $this->makeRequest( |
| 235 | - RequestFactory::createPropFindRequest |
|
| 236 | - ( |
|
| 232 | + RequestFactory::createPropFindRequest( |
|
| 237 | 233 | $calendar_home_set_url, |
| 238 | 234 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarsRequestType)->getContent() |
| 239 | 235 | ) |
| 240 | 236 | ); |
| 241 | 237 | |
| 242 | - return new GetCalendarsResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
| 238 | + return new GetCalendarsResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode()); |
|
| 243 | 239 | } |
| 244 | 240 | |
| 245 | 241 | /** |
@@ -249,15 +245,14 @@ discard block |
||
| 249 | 245 | public function getCalendar($calendar_url) |
| 250 | 246 | { |
| 251 | 247 | $http_response = $this->makeRequest( |
| 252 | - RequestFactory::createPropFindRequest |
|
| 253 | - ( |
|
| 248 | + RequestFactory::createPropFindRequest( |
|
| 254 | 249 | $calendar_url, |
| 255 | 250 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarRequestType)->getContent(), |
| 256 | 251 | 0 |
| 257 | 252 | ) |
| 258 | 253 | ); |
| 259 | 254 | |
| 260 | - return new GetCalendarResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
| 255 | + return new GetCalendarResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode()); |
|
| 261 | 256 | } |
| 262 | 257 | |
| 263 | 258 | |
@@ -270,14 +265,13 @@ discard block |
||
| 270 | 265 | { |
| 271 | 266 | |
| 272 | 267 | $http_response = $this->makeRequest( |
| 273 | - RequestFactory::createReportRequest |
|
| 274 | - ( |
|
| 268 | + RequestFactory::createReportRequest( |
|
| 275 | 269 | $calendar_url, |
| 276 | 270 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarSyncRequestType, [$sync_token])->getContent() |
| 277 | 271 | ) |
| 278 | 272 | ); |
| 279 | 273 | |
| 280 | - return new CalendarSyncInfoResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
| 274 | + return new CalendarSyncInfoResponse($this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode()); |
|
| 281 | 275 | } |
| 282 | 276 | |
| 283 | 277 | /** |
@@ -290,19 +284,17 @@ discard block |
||
| 290 | 284 | $uid = $vo->getUID(); |
| 291 | 285 | $resource_url = $calendar_url.$uid.self::SchedulingInformationSuffix; |
| 292 | 286 | $http_response = $this->makeRequest( |
| 293 | - RequestFactory::createPutRequest |
|
| 294 | - ( |
|
| 287 | + RequestFactory::createPutRequest( |
|
| 295 | 288 | $resource_url, |
| 296 | 289 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::EventCreateRequestType, [$vo])->getContent() |
| 297 | 290 | ) |
| 298 | 291 | ); |
| 299 | 292 | $etag = $http_response->hasHeader(self::ETagHeader) ? $http_response->getHeaderLine(self::ETagHeader) : null; |
| 300 | - return new EventCreatedResponse |
|
| 301 | - ( |
|
| 293 | + return new EventCreatedResponse( |
|
| 302 | 294 | $uid, |
| 303 | 295 | $etag, |
| 304 | 296 | $resource_url, |
| 305 | - (string)$http_response->getBody(), |
|
| 297 | + (string) $http_response->getBody(), |
|
| 306 | 298 | $http_response->getStatusCode() |
| 307 | 299 | ); |
| 308 | 300 | } |
@@ -318,20 +310,18 @@ discard block |
||
| 318 | 310 | $uid = $vo->getUID(); |
| 319 | 311 | $resource_url = $calendar_url.$uid.self::SchedulingInformationSuffix; |
| 320 | 312 | $http_response = $this->makeRequest( |
| 321 | - RequestFactory::createPutRequest |
|
| 322 | - ( |
|
| 313 | + RequestFactory::createPutRequest( |
|
| 323 | 314 | $resource_url, |
| 324 | 315 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::EventUpdateRequestType, [$vo])->getContent(), |
| 325 | 316 | $etag |
| 326 | 317 | ) |
| 327 | 318 | ); |
| 328 | 319 | $etag = $http_response->hasHeader(self::ETagHeader) ? $http_response->getHeaderLine(self::ETagHeader) : null; |
| 329 | - return new EventUpdatedResponse |
|
| 330 | - ( |
|
| 320 | + return new EventUpdatedResponse( |
|
| 331 | 321 | $uid, |
| 332 | 322 | $etag, |
| 333 | 323 | $resource_url, |
| 334 | - (string)$http_response->getBody(), |
|
| 324 | + (string) $http_response->getBody(), |
|
| 335 | 325 | $http_response->getStatusCode() |
| 336 | 326 | ); |
| 337 | 327 | } |
@@ -345,16 +335,14 @@ discard block |
||
| 345 | 335 | public function deleteEvent($calendar_url, $uid, $etag = null) |
| 346 | 336 | { |
| 347 | 337 | $http_response = $this->makeRequest( |
| 348 | - RequestFactory::createDeleteRequest |
|
| 349 | - ( |
|
| 338 | + RequestFactory::createDeleteRequest( |
|
| 350 | 339 | $calendar_url.$uid.self::SchedulingInformationSuffix, |
| 351 | 340 | $etag |
| 352 | 341 | ) |
| 353 | 342 | ); |
| 354 | 343 | |
| 355 | - return new EventDeletedResponse |
|
| 356 | - ( |
|
| 357 | - (string)$http_response->getBody(), $http_response->getStatusCode() |
|
| 344 | + return new EventDeletedResponse( |
|
| 345 | + (string) $http_response->getBody(), $http_response->getStatusCode() |
|
| 358 | 346 | ); |
| 359 | 347 | } |
| 360 | 348 | |
@@ -362,15 +350,14 @@ discard block |
||
| 362 | 350 | * @param string $event_url |
| 363 | 351 | * @return string |
| 364 | 352 | */ |
| 365 | - public function getEventVCardBy($event_url){ |
|
| 353 | + public function getEventVCardBy($event_url) { |
|
| 366 | 354 | $http_response = $this->makeRequest( |
| 367 | - RequestFactory::createGetRequest |
|
| 368 | - ( |
|
| 355 | + RequestFactory::createGetRequest( |
|
| 369 | 356 | $event_url |
| 370 | 357 | ) |
| 371 | 358 | ); |
| 372 | 359 | |
| 373 | - $ical = (string)$http_response->getBody(); |
|
| 360 | + $ical = (string) $http_response->getBody(); |
|
| 374 | 361 | return $ical; |
| 375 | 362 | } |
| 376 | 363 | |
@@ -382,17 +369,15 @@ discard block |
||
| 382 | 369 | public function getEventsBy($calendar_url, array $events_urls) |
| 383 | 370 | { |
| 384 | 371 | $http_response = $this->makeRequest( |
| 385 | - RequestFactory::createReportRequest |
|
| 386 | - ( |
|
| 372 | + RequestFactory::createReportRequest( |
|
| 387 | 373 | $calendar_url, |
| 388 | 374 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarMultiGetRequestType, [$events_urls])->getContent() |
| 389 | 375 | ) |
| 390 | 376 | ); |
| 391 | 377 | |
| 392 | - return new ResourceCollectionResponse |
|
| 393 | - ( |
|
| 378 | + return new ResourceCollectionResponse( |
|
| 394 | 379 | $this->server_url, |
| 395 | - (string)$http_response->getBody(), |
|
| 380 | + (string) $http_response->getBody(), |
|
| 396 | 381 | $http_response->getStatusCode() |
| 397 | 382 | ); |
| 398 | 383 | } |
@@ -406,17 +391,15 @@ discard block |
||
| 406 | 391 | { |
| 407 | 392 | |
| 408 | 393 | $http_response = $this->makeRequest( |
| 409 | - RequestFactory::createReportRequest |
|
| 410 | - ( |
|
| 394 | + RequestFactory::createReportRequest( |
|
| 411 | 395 | $calendar_url, |
| 412 | 396 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarQueryRequestType, [$filter])->getContent() |
| 413 | 397 | ) |
| 414 | 398 | ); |
| 415 | 399 | |
| 416 | - return new ResourceCollectionResponse |
|
| 417 | - ( |
|
| 400 | + return new ResourceCollectionResponse( |
|
| 418 | 401 | $this->server_url, |
| 419 | - (string)$http_response->getBody(), |
|
| 402 | + (string) $http_response->getBody(), |
|
| 420 | 403 | $http_response->getStatusCode() |
| 421 | 404 | ); |
| 422 | 405 | } |
@@ -429,16 +412,14 @@ discard block |
||
| 429 | 412 | public function deleteCalendar($calendar_url, $etag = null) |
| 430 | 413 | { |
| 431 | 414 | $http_response = $this->makeRequest( |
| 432 | - RequestFactory::createDeleteRequest |
|
| 433 | - ( |
|
| 415 | + RequestFactory::createDeleteRequest( |
|
| 434 | 416 | $calendar_url, |
| 435 | 417 | $etag |
| 436 | 418 | ) |
| 437 | 419 | ); |
| 438 | 420 | |
| 439 | - return new CalendarDeletedResponse |
|
| 440 | - ( |
|
| 441 | - $this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode() |
|
| 421 | + return new CalendarDeletedResponse( |
|
| 422 | + $this->server_url, (string) $http_response->getBody(), $http_response->getStatusCode() |
|
| 442 | 423 | ); |
| 443 | 424 | } |
| 444 | 425 | } |
| 445 | 426 | \ No newline at end of file |