@@ -25,9 +25,10 @@ |
||
25 | 25 | $url = 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 | // check on not found one ( issue on caldav icloud imp) |
28 | - if(empty($url)) |
|
29 | - $url = isset($this->not_found_props['current-user-principal']) && isset($this->not_found_props['current-user-principal']['href']) ? |
|
28 | + if(empty($url)) { |
|
29 | + $url = isset($this->not_found_props['current-user-principal']) && isset($this->not_found_props['current-user-principal']['href']) ? |
|
30 | 30 | $this->server_url.$this->not_found_props['current-user-principal']['href'] : null; |
31 | + } |
|
31 | 32 | return $url; |
32 | 33 | } |
33 | 34 | } |
34 | 35 | \ No newline at end of file |
@@ -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 ($this->statusMatches($propstat['status'], AbstractCalDAVResponse::HttpOKStatus)) |
|
68 | - $this->found_props = $propstat['prop']; |
|
73 | + if ($this->statusMatches($propstat['status'], AbstractCalDAVResponse::HttpOKStatus)) { |
|
74 | + $this->found_props = $propstat['prop']; |
|
75 | + } |
|
69 | 76 | |
70 | - if ($this->statusMatches($propstat['status'], AbstractCalDAVResponse::HttpNotFoundStatus)) |
|
71 | - $this->not_found_props = $propstat['prop']; |
|
77 | + if ($this->statusMatches($propstat['status'], AbstractCalDAVResponse::HttpNotFoundStatus)) { |
|
78 | + $this->not_found_props = $propstat['prop']; |
|
79 | + } |
|
72 | 80 | } |
73 | 81 | return $this; |
74 | 82 | } |
@@ -30,8 +30,12 @@ |
||
30 | 30 | */ |
31 | 31 | public function getStatus() |
32 | 32 | { |
33 | - if(isset($this->content['response']['status'])) return $this->content['response']['status']; |
|
34 | - if(isset($this->content['response']['propstat']['status'])) return $this->content['response']['propstat']['status']; |
|
33 | + if(isset($this->content['response']['status'])) { |
|
34 | + return $this->content['response']['status']; |
|
35 | + } |
|
36 | + if(isset($this->content['response']['propstat']['status'])) { |
|
37 | + return $this->content['response']['propstat']['status']; |
|
38 | + } |
|
35 | 39 | |
36 | 40 | return null; |
37 | 41 | } |