@@ -59,7 +59,7 @@ |
||
| 59 | 59 | |
| 60 | 60 | if($time_zone->getName() == 'UTC'){ |
| 61 | 61 | $event->setUseUtc(true) |
| 62 | - ->setUseTimezone(false); |
|
| 62 | + ->setUseTimezone(false); |
|
| 63 | 63 | } |
| 64 | 64 | else{ |
| 65 | 65 | $event->setUseUtc(false) |
@@ -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 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | public function __construct(){ |
| 23 | 23 | $this->properties = [ |
| 24 | - '{DAV:}current-user-principal' |
|
| 24 | + '{DAV:}current-user-principal' |
|
| 25 | 25 | ]; |
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | \ No newline at end of file |
@@ -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 | ]; |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function getContent() |
| 39 | 39 | { |
| 40 | - $service = new Service(); |
|
| 40 | + $service = new Service(); |
|
| 41 | 41 | |
| 42 | 42 | $service->namespaceMap = [ |
| 43 | 43 | 'DAV:' => 'D', |
@@ -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); |
@@ -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', |
@@ -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 | |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | */ |
| 79 | 79 | protected function isValid() |
| 80 | 80 | { |
| 81 | - return parent::isValid() ; |
|
| 81 | + return parent::isValid(); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -41,8 +41,12 @@ discard block |
||
| 41 | 41 | protected function parse() |
| 42 | 42 | { |
| 43 | 43 | |
| 44 | - if (!$this->isValid()) throw new NotValidGenericSingleCalDAVResponseException(); |
|
| 45 | - if (!isset($this->content['response']['propstat'])) return $this; |
|
| 44 | + if (!$this->isValid()) { |
|
| 45 | + throw new NotValidGenericSingleCalDAVResponseException(); |
|
| 46 | + } |
|
| 47 | + if (!isset($this->content['response']['propstat'])) { |
|
| 48 | + return $this; |
|
| 49 | + } |
|
| 46 | 50 | if (isset($this->content['response']['propstat']['prop']) && isset($this->content['response']['propstat']['status'])) { |
| 47 | 51 | // all props found |
| 48 | 52 | $status = $this->content['response']['propstat']['status']; |
@@ -62,13 +66,17 @@ discard block |
||
| 62 | 66 | // multi props ( found or not found) |
| 63 | 67 | foreach ($this->content['response']['propstat'] as $propstat) { |
| 64 | 68 | |
| 65 | - if (!isset($propstat['status']) || !isset($propstat['prop'])) continue; |
|
| 69 | + if (!isset($propstat['status']) || !isset($propstat['prop'])) { |
|
| 70 | + continue; |
|
| 71 | + } |
|
| 66 | 72 | |
| 67 | - if ($propstat['status'] == AbstractCalDAVResponse::HttpOKStatus) |
|
| 68 | - $this->found_props = $propstat['prop']; |
|
| 73 | + if ($propstat['status'] == AbstractCalDAVResponse::HttpOKStatus) { |
|
| 74 | + $this->found_props = $propstat['prop']; |
|
| 75 | + } |
|
| 69 | 76 | |
| 70 | - if ($propstat['status'] == AbstractCalDAVResponse::HttpNotFoundStatus) |
|
| 71 | - $this->not_found_props = $propstat['prop']; |
|
| 77 | + if ($propstat['status'] == AbstractCalDAVResponse::HttpNotFoundStatus) { |
|
| 78 | + $this->not_found_props = $propstat['prop']; |
|
| 79 | + } |
|
| 72 | 80 | } |
| 73 | 81 | return $this; |
| 74 | 82 | } |