| @@ -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 | } | 
| @@ -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 | } | 
| @@ -40,7 +40,9 @@ discard block | ||
| 40 | 40 | * @return CalDAVRequestFactory | 
| 41 | 41 | */ | 
| 42 | 42 |      public static function getInstance(){ | 
| 43 | - if(is_null(self::$instance)) self::$instance = new CalDAVRequestFactory(); | |
| 43 | +        if(is_null(self::$instance)) { | |
| 44 | + self::$instance = new CalDAVRequestFactory(); | |
| 45 | + } | |
| 44 | 46 | return self::$instance; | 
| 45 | 47 | } | 
| 46 | 48 | |
| @@ -61,28 +63,34 @@ discard block | ||
| 61 | 63 | case self::CalendarRequestType: | 
| 62 | 64 | return new GetCalendarRequest(); | 
| 63 | 65 | case self::CalendarSyncRequestType: | 
| 64 | - if(count($params) == 0 ) | |
| 65 | - throw new \InvalidArgumentException(); | |
| 66 | +                if(count($params) == 0 ) { | |
| 67 | + throw new \InvalidArgumentException(); | |
| 68 | + } | |
| 66 | 69 | return new CalendarSyncRequest($params[0]); | 
| 67 | 70 | case self::CalendarMultiGetRequestType: | 
| 68 | - if(count($params) == 0 ) | |
| 69 | - throw new \InvalidArgumentException(); | |
| 71 | +                if(count($params) == 0 ) { | |
| 72 | + throw new \InvalidArgumentException(); | |
| 73 | + } | |
| 70 | 74 | return new CalendarMultiGetRequest($params[0]); | 
| 71 | 75 | case self::CalendarQueryRequestType: | 
| 72 | - if(count($params) == 0 ) | |
| 73 | - throw new \InvalidArgumentException(); | |
| 76 | +                if(count($params) == 0 ) { | |
| 77 | + throw new \InvalidArgumentException(); | |
| 78 | + } | |
| 74 | 79 | return new CalendarQueryRequest($params[0]); | 
| 75 | 80 | case self::CalendarCreateRequestType: | 
| 76 | - if(count($params) == 0 ) | |
| 77 | - throw new \InvalidArgumentException(); | |
| 81 | +                if(count($params) == 0 ) { | |
| 82 | + throw new \InvalidArgumentException(); | |
| 83 | + } | |
| 78 | 84 | return new CalendarCreateRequest($params[0]); | 
| 79 | 85 | case self::EventCreateRequestType: | 
| 80 | - if(count($params) == 0 ) | |
| 81 | - throw new \InvalidArgumentException(); | |
| 86 | +                if(count($params) == 0 ) { | |
| 87 | + throw new \InvalidArgumentException(); | |
| 88 | + } | |
| 82 | 89 | return new EventCreateRequest($params[0]); | 
| 83 | 90 | case self::EventUpdateRequestType: | 
| 84 | - if(count($params) == 0 ) | |
| 85 | - throw new \InvalidArgumentException(); | |
| 91 | +                if(count($params) == 0 ) { | |
| 92 | + throw new \InvalidArgumentException(); | |
| 93 | + } | |
| 86 | 94 | return new EventUpdateRequest($params[0]); | 
| 87 | 95 | } | 
| 88 | 96 | return null; | 
| @@ -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 | |