@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * @return string |
23 | 23 | */ |
24 | - public function getDisplayName(){ |
|
24 | + public function getDisplayName() { |
|
25 | 25 | return isset($this->found_props['displayname']) ? $this->found_props['displayname'] : null; |
26 | 26 | } |
27 | 27 | |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | * @see https://tools.ietf.org/html/rfc6578 |
30 | 30 | * @return string |
31 | 31 | */ |
32 | - public function getSyncToken(){ |
|
32 | + public function getSyncToken() { |
|
33 | 33 | return isset($this->found_props['sync-token']) ? $this->found_props['sync-token'] : null; |
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @return string |
38 | 38 | */ |
39 | - public function getCTag(){ |
|
39 | + public function getCTag() { |
|
40 | 40 | return isset($this->found_props['getctag']) ? $this->found_props['getctag'] : null; |
41 | 41 | } |
42 | 42 |
@@ -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 | /** |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * @return string |
23 | 23 | */ |
24 | - public function getCalendarHomeSetUrl(){ |
|
24 | + public function getCalendarHomeSetUrl() { |
|
25 | 25 | return isset($this->found_props['calendar-home-set']) && isset($this->found_props['calendar-home-set']['href']) ? |
26 | 26 | $this->found_props['calendar-home-set']['href'] : null; |
27 | 27 | } |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * @return string|null |
31 | 31 | */ |
32 | - public function getRealCalDAVHost(){ |
|
32 | + public function getRealCalDAVHost() { |
|
33 | 33 | $url = $this->getCalendarHomeSetUrl(); |
34 | - return !empty($url) ? parse_url($url,PHP_URL_HOST) : null; |
|
34 | + return !empty($url) ? parse_url($url, PHP_URL_HOST) : null; |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | \ No newline at end of file |
@@ -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 |
@@ -22,14 +22,14 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * @return string|null |
24 | 24 | */ |
25 | - public function getSyncToken(){ |
|
26 | - return isset($this->content['sync-token'])? $this->content['sync-token'] : null; |
|
25 | + public 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 | - public function hasAvailableChanges(){ |
|
32 | + public 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 | - public function getUpdates(){ |
|
40 | + public 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 | - public function getDeletes(){ |
|
52 | + public 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,13 +40,13 @@ discard block |
||
40 | 40 | * @param string|null $body |
41 | 41 | * @param int $code |
42 | 42 | */ |
43 | - public function __construct($server_url = null, $body = null, $code = HttpResponse::HttpCodeOk ) |
|
43 | + public function __construct($server_url = null, $body = null, $code = HttpResponse::HttpCodeOk) |
|
44 | 44 | { |
45 | 45 | parent::__construct($body, $code); |
46 | 46 | $this->server_url = $server_url; |
47 | - if(!empty($this->body)) { |
|
48 | - $this->xml = simplexml_load_string($this->body, 'SimpleXMLElement', LIBXML_NOCDATA); |
|
49 | - if($this->xml === FALSE) |
|
47 | + if (!empty($this->body)) { |
|
48 | + $this->xml = simplexml_load_string($this->body, 'SimpleXMLElement', LIBXML_NOCDATA); |
|
49 | + if ($this->xml === FALSE) |
|
50 | 50 | throw new XMLResponseParseException(); |
51 | 51 | $this->content = $this->toAssocArray($this->xml); |
52 | 52 | $this->parse(); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | } |
59 | 59 | |
60 | - protected function setContent($content){ |
|
60 | + protected function setContent($content) { |
|
61 | 61 | $this->content = $content; |
62 | 62 | } |
63 | 63 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | /** |
76 | 76 | * @return bool |
77 | 77 | */ |
78 | - protected function isValid(){ |
|
78 | + protected function isValid() { |
|
79 | 79 | return isset($this->content['response']); |
80 | 80 | } |
81 | 81 | } |
82 | 82 | \ No newline at end of file |
@@ -94,8 +94,7 @@ discard block |
||
94 | 94 | * @param string $location_lat |
95 | 95 | * @param string $location_lng |
96 | 96 | */ |
97 | - public function __construct |
|
98 | - ( |
|
97 | + public function __construct( |
|
99 | 98 | $prod_id, |
100 | 99 | $title, |
101 | 100 | $description, |
@@ -121,7 +120,7 @@ discard block |
||
121 | 120 | $this->location_lat = $location_lat; |
122 | 121 | $this->location_lng = $location_lng; |
123 | 122 | $this->time_zone = $time_zone; |
124 | - if(is_null($this->time_zone)){ |
|
123 | + if (is_null($this->time_zone)) { |
|
125 | 124 | $this->time_zone = new DateTimeZone('UTC'); |
126 | 125 | } |
127 | 126 | } |
@@ -129,7 +128,7 @@ discard block |
||
129 | 128 | /** |
130 | 129 | * @param string $uid |
131 | 130 | */ |
132 | - public function setUID($uid){ |
|
131 | + public function setUID($uid) { |
|
133 | 132 | $this->uid = $uid; |
134 | 133 | } |
135 | 134 | |
@@ -216,7 +215,7 @@ discard block |
||
216 | 215 | /** |
217 | 216 | * @return DateTimeZone |
218 | 217 | */ |
219 | - public function getTimeZone(){ |
|
218 | + public function getTimeZone() { |
|
220 | 219 | return $this->time_zone; |
221 | 220 | } |
222 | 221 |
@@ -59,17 +59,15 @@ |
||
59 | 59 | 'attributes' => ['name' => 'VEVENT'] |
60 | 60 | ] |
61 | 61 | ], |
62 | - '{urn:ietf:params:xml:ns:caldav}calendar-timezone' => new Cdata |
|
63 | - ( |
|
64 | - ICalTimeZoneBuilder::build |
|
65 | - ( |
|
62 | + '{urn:ietf:params:xml:ns:caldav}calendar-timezone' => new Cdata( |
|
63 | + ICalTimeZoneBuilder::build( |
|
66 | 64 | $this->vo->getTimezone(), |
67 | 65 | $this->vo->getDisplayName() |
68 | 66 | )->render() |
69 | 67 | ) |
70 | 68 | ]; |
71 | 69 | |
72 | - if(!empty($this->vo->getDescription())) |
|
70 | + if (!empty($this->vo->getDescription())) |
|
73 | 71 | $props['{urn:ietf:params:xml:ns:caldav}calendar-description'] = $this->vo->getDescription(); |
74 | 72 | |
75 | 73 | return $service->write('{urn:ietf:params:xml:ns:caldav}mkcalendar', |
@@ -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 | } |