@@ -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 | } |
@@ -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 | [ |
@@ -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 |
@@ -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 |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | |
26 | 26 | protected function parse() |
27 | 27 | { |
28 | - if(isset($this->content['response']) && !isset($this->content['response']['propstat']) && count($this->content['response'] > 0)){ |
|
29 | - foreach($this->content['response'] as $val){ |
|
28 | + if (isset($this->content['response']) && !isset($this->content['response']['propstat']) && count($this->content['response'] > 0)) { |
|
29 | + foreach ($this->content['response'] as $val) { |
|
30 | 30 | $single_resource = $this->buildSingleResponse(); |
31 | 31 | $single_resource->setContent(['response' => $val]); |
32 | 32 | $single_resource->parse(); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * @return GenericSinglePROPFINDCalDAVResponse[] |
40 | 40 | */ |
41 | - public function getResponses(){ |
|
41 | + public function getResponses() { |
|
42 | 42 | return $this->responses; |
43 | 43 | } |
44 | 44 |
@@ -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 |