@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | final class CalDAVRequestFactory implements ICalDAVRequestFactory |
| 20 | 20 | { |
| 21 | - private function __construct(){} |
|
| 21 | + private function __construct() {} |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * @var ICalDAVRequestFactory |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * @return ICalDAVRequestFactory |
| 30 | 30 | */ |
| 31 | - public static function getInstance(){ |
|
| 32 | - if(is_null(self::$instance)) self::$instance = new CalDAVRequestFactory(); |
|
| 31 | + public static function getInstance() { |
|
| 32 | + if (is_null(self::$instance)) self::$instance = new CalDAVRequestFactory(); |
|
| 33 | 33 | return self::$instance; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | * @return IAbstractWebDAVRequest|null |
| 48 | 48 | * @throws \InvalidArgumentException |
| 49 | 49 | */ |
| 50 | - public function build($type, $params = []){ |
|
| 51 | - switch(strtoupper($type)){ |
|
| 50 | + public function build($type, $params = []) { |
|
| 51 | + switch (strtoupper($type)) { |
|
| 52 | 52 | case self::PrincipalRequestType: |
| 53 | 53 | return new UserPrincipalRequest(); |
| 54 | 54 | case self::CalendarHomeRequestType: |
@@ -58,27 +58,27 @@ discard block |
||
| 58 | 58 | case self::CalendarRequestType: |
| 59 | 59 | return new GetCalendarRequest(); |
| 60 | 60 | case self::CalendarSyncRequestType: |
| 61 | - if(count($params) == 0 ) |
|
| 61 | + if (count($params) == 0) |
|
| 62 | 62 | throw new \InvalidArgumentException(); |
| 63 | 63 | return new CalendarSyncRequest($params[0]); |
| 64 | 64 | case self::CalendarMultiGetRequestType: |
| 65 | - if(count($params) == 0 ) |
|
| 65 | + if (count($params) == 0) |
|
| 66 | 66 | throw new \InvalidArgumentException(); |
| 67 | 67 | return new CalendarMultiGetRequest($params[0]); |
| 68 | 68 | case self::CalendarQueryRequestType: |
| 69 | - if(count($params) == 0 ) |
|
| 69 | + if (count($params) == 0) |
|
| 70 | 70 | throw new \InvalidArgumentException(); |
| 71 | 71 | return new CalendarQueryRequest($params[0]); |
| 72 | 72 | case self::CalendarCreateRequestType: |
| 73 | - if(count($params) == 0 ) |
|
| 73 | + if (count($params) == 0) |
|
| 74 | 74 | throw new \InvalidArgumentException(); |
| 75 | 75 | return new CalendarCreateRequest($params[0]); |
| 76 | 76 | case self::EventCreateRequestType: |
| 77 | - if(count($params) == 0 ) |
|
| 77 | + if (count($params) == 0) |
|
| 78 | 78 | throw new \InvalidArgumentException(); |
| 79 | 79 | return new EventCreateRequest($params[0]); |
| 80 | 80 | case self::EventUpdateRequestType: |
| 81 | - if(count($params) == 0 ) |
|
| 81 | + if (count($params) == 0) |
|
| 82 | 82 | throw new \InvalidArgumentException(); |
| 83 | 83 | return new EventUpdateRequest($params[0]); |
| 84 | 84 | } |
@@ -29,7 +29,9 @@ discard block |
||
| 29 | 29 | * @return ICalDAVRequestFactory |
| 30 | 30 | */ |
| 31 | 31 | public static function getInstance(){ |
| 32 | - if(is_null(self::$instance)) self::$instance = new CalDAVRequestFactory(); |
|
| 32 | + if(is_null(self::$instance)) { |
|
| 33 | + self::$instance = new CalDAVRequestFactory(); |
|
| 34 | + } |
|
| 33 | 35 | return self::$instance; |
| 34 | 36 | } |
| 35 | 37 | |
@@ -58,28 +60,34 @@ discard block |
||
| 58 | 60 | case self::CalendarRequestType: |
| 59 | 61 | return new GetCalendarRequest(); |
| 60 | 62 | case self::CalendarSyncRequestType: |
| 61 | - if(count($params) == 0 ) |
|
| 62 | - throw new \InvalidArgumentException(); |
|
| 63 | + if(count($params) == 0 ) { |
|
| 64 | + throw new \InvalidArgumentException(); |
|
| 65 | + } |
|
| 63 | 66 | return new CalendarSyncRequest($params[0]); |
| 64 | 67 | case self::CalendarMultiGetRequestType: |
| 65 | - if(count($params) == 0 ) |
|
| 66 | - throw new \InvalidArgumentException(); |
|
| 68 | + if(count($params) == 0 ) { |
|
| 69 | + throw new \InvalidArgumentException(); |
|
| 70 | + } |
|
| 67 | 71 | return new CalendarMultiGetRequest($params[0]); |
| 68 | 72 | case self::CalendarQueryRequestType: |
| 69 | - if(count($params) == 0 ) |
|
| 70 | - throw new \InvalidArgumentException(); |
|
| 73 | + if(count($params) == 0 ) { |
|
| 74 | + throw new \InvalidArgumentException(); |
|
| 75 | + } |
|
| 71 | 76 | return new CalendarQueryRequest($params[0]); |
| 72 | 77 | case self::CalendarCreateRequestType: |
| 73 | - if(count($params) == 0 ) |
|
| 74 | - throw new \InvalidArgumentException(); |
|
| 78 | + if(count($params) == 0 ) { |
|
| 79 | + throw new \InvalidArgumentException(); |
|
| 80 | + } |
|
| 75 | 81 | return new CalendarCreateRequest($params[0]); |
| 76 | 82 | case self::EventCreateRequestType: |
| 77 | - if(count($params) == 0 ) |
|
| 78 | - throw new \InvalidArgumentException(); |
|
| 83 | + if(count($params) == 0 ) { |
|
| 84 | + throw new \InvalidArgumentException(); |
|
| 85 | + } |
|
| 79 | 86 | return new EventCreateRequest($params[0]); |
| 80 | 87 | case self::EventUpdateRequestType: |
| 81 | - if(count($params) == 0 ) |
|
| 82 | - throw new \InvalidArgumentException(); |
|
| 88 | + if(count($params) == 0 ) { |
|
| 89 | + throw new \InvalidArgumentException(); |
|
| 90 | + } |
|
| 83 | 91 | return new EventUpdateRequest($params[0]); |
| 84 | 92 | } |
| 85 | 93 | return null; |