@@ -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); |
@@ -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 | } |
@@ -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 |