@@ -19,20 +19,20 @@ |
||
| 19 | 19 | public static function fromArray(array $data): self |
| 20 | 20 | { |
| 21 | 21 | return new self( |
| 22 | - $data['activeWorkspace'], |
|
| 23 | - $data['defaultWorkspace'], |
|
| 24 | - $data['email'], |
|
| 25 | - $data['id'], |
|
| 22 | + $data[ 'activeWorkspace' ], |
|
| 23 | + $data[ 'defaultWorkspace' ], |
|
| 24 | + $data[ 'email' ], |
|
| 25 | + $data[ 'id' ], |
|
| 26 | 26 | array_map( |
| 27 | 27 | static function(array $membership): MembershipDto { |
| 28 | 28 | return MembershipDto::fromArray($membership); |
| 29 | 29 | }, |
| 30 | - $data['memberships'] |
|
| 30 | + $data[ 'memberships' ] |
|
| 31 | 31 | ), |
| 32 | - $data['name'], |
|
| 33 | - $data['profilePicture'], |
|
| 34 | - UserSettingsDto::fromArray($data['settings']), |
|
| 35 | - new UserStatus($data['status']) |
|
| 32 | + $data[ 'name' ], |
|
| 33 | + $data[ 'profilePicture' ], |
|
| 34 | + UserSettingsDto::fromArray($data[ 'settings' ]), |
|
| 35 | + new UserStatus($data[ 'status' ]) |
|
| 36 | 36 | ); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -12,8 +12,8 @@ |
||
| 12 | 12 | public static function fromArray(array $data): self |
| 13 | 13 | { |
| 14 | 14 | return new self( |
| 15 | - $data['group'], |
|
| 16 | - $data['subgroup'] |
|
| 15 | + $data[ 'group' ], |
|
| 16 | + $data[ 'subgroup' ] |
|
| 17 | 17 | ); |
| 18 | 18 | } |
| 19 | 19 | |
@@ -19,20 +19,20 @@ |
||
| 19 | 19 | public static function fromArray(array $data): self |
| 20 | 20 | { |
| 21 | 21 | return new self( |
| 22 | - $data['activeWorkspace'], |
|
| 23 | - $data['defaultWorkspace'], |
|
| 24 | - $data['email'], |
|
| 25 | - $data['id'], |
|
| 22 | + $data[ 'activeWorkspace' ], |
|
| 23 | + $data[ 'defaultWorkspace' ], |
|
| 24 | + $data[ 'email' ], |
|
| 25 | + $data[ 'id' ], |
|
| 26 | 26 | array_map( |
| 27 | 27 | static function(array $membership): MembershipDto { |
| 28 | 28 | return MembershipDto::fromArray($membership); |
| 29 | 29 | }, |
| 30 | - $data['memberships'] |
|
| 30 | + $data[ 'memberships' ] |
|
| 31 | 31 | ), |
| 32 | - $data['name'], |
|
| 33 | - $data['profilePicture'], |
|
| 34 | - UserSettingsDto::fromArray($data['settings']), |
|
| 35 | - new UserStatus($data['status']) |
|
| 32 | + $data[ 'name' ], |
|
| 33 | + $data[ 'profilePicture' ], |
|
| 34 | + UserSettingsDto::fromArray($data[ 'settings' ]), |
|
| 35 | + new UserStatus($data[ 'status' ]) |
|
| 36 | 36 | ); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -40,13 +40,13 @@ discard block |
||
| 40 | 40 | return TimeEntryDtoImpl::fromArray($data); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - public function entry(string $workspaceId, string $id, array $params = []): TimeEntryDtoImpl |
|
| 43 | + public function entry(string $workspaceId, string $id, array $params = [ ]): TimeEntryDtoImpl |
|
| 44 | 44 | { |
| 45 | - if (isset($params['consider-duration-format']) && !is_bool($params['consider-duration-format'])) { |
|
| 45 | + if (isset($params[ 'consider-duration-format' ]) && !is_bool($params[ 'consider-duration-format' ])) { |
|
| 46 | 46 | throw new ClockifyException('Invalid "consider-duration-format" parameter (should be a boolean value)'); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - if (isset($params['hydrated']) && !is_bool($params['hydrated'])) { |
|
| 49 | + if (isset($params[ 'hydrated' ]) && !is_bool($params[ 'hydrated' ])) { |
|
| 50 | 50 | throw new ClockifyException('Invalid "hydrated" parameter (should be a boolean value)'); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -67,57 +67,57 @@ discard block |
||
| 67 | 67 | return TimeEntryDtoImpl::fromArray($data); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - public function find(string $workspaceId, string $userId, array $params = []): array |
|
| 70 | + public function find(string $workspaceId, string $userId, array $params = [ ]): array |
|
| 71 | 71 | { |
| 72 | - if (isset($params['description']) && !is_string($params['description'])) { |
|
| 72 | + if (isset($params[ 'description' ]) && !is_string($params[ 'description' ])) { |
|
| 73 | 73 | throw new ClockifyException('Invalid "description" parameter'); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - if (isset($params['start']) && !is_string($params['start'])) { |
|
| 76 | + if (isset($params[ 'start' ]) && !is_string($params[ 'start' ])) { |
|
| 77 | 77 | throw new ClockifyException('Invalid "start" parameter'); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - if (isset($params['end']) && !is_string($params['end'])) { |
|
| 80 | + if (isset($params[ 'end' ]) && !is_string($params[ 'end' ])) { |
|
| 81 | 81 | throw new ClockifyException('Invalid "end" parameter'); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if (isset($params['project']) && !is_string($params['project'])) { |
|
| 84 | + if (isset($params[ 'project' ]) && !is_string($params[ 'project' ])) { |
|
| 85 | 85 | throw new ClockifyException('Invalid "project" parameter'); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - if (isset($params['task']) && !is_string($params['task'])) { |
|
| 88 | + if (isset($params[ 'task' ]) && !is_string($params[ 'task' ])) { |
|
| 89 | 89 | throw new ClockifyException('Invalid "task" parameter'); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - if (isset($params['tags']) && !is_array($params['tags'])) { |
|
| 92 | + if (isset($params[ 'tags' ]) && !is_array($params[ 'tags' ])) { |
|
| 93 | 93 | throw new ClockifyException('Invalid "tags" parameter'); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - if (isset($params['project-required']) && !is_bool($params['project-required'])) { |
|
| 96 | + if (isset($params[ 'project-required' ]) && !is_bool($params[ 'project-required' ])) { |
|
| 97 | 97 | throw new ClockifyException('Invalid "project-required" parameter'); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if (isset($params['task-required']) && !is_bool($params['task-required'])) { |
|
| 100 | + if (isset($params[ 'task-required' ]) && !is_bool($params[ 'task-required' ])) { |
|
| 101 | 101 | throw new ClockifyException('Invalid "task-required" parameter'); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - if (isset($params['consider-duration-format']) && !is_bool($params['consider-duration-format'])) { |
|
| 104 | + if (isset($params[ 'consider-duration-format' ]) && !is_bool($params[ 'consider-duration-format' ])) { |
|
| 105 | 105 | throw new ClockifyException('Invalid "consider-duration-format" parameter'); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if (isset($params['hydrated']) && !is_bool($params['hydrated'])) { |
|
| 108 | + if (isset($params[ 'hydrated' ]) && !is_bool($params[ 'hydrated' ])) { |
|
| 109 | 109 | throw new ClockifyException('Invalid "hydrated" parameter'); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - if (isset($params['in-progress']) && !is_bool($params['in-progress'])) { |
|
| 112 | + if (isset($params[ 'in-progress' ]) && !is_bool($params[ 'in-progress' ])) { |
|
| 113 | 113 | throw new ClockifyException('Invalid "in-progress" parameter'); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if (isset($params['page']) && (!is_int($params['page']) || $params['page'] < 1)) { |
|
| 116 | + if (isset($params[ 'page' ]) && (!is_int($params[ 'page' ]) || $params[ 'page' ] < 1)) { |
|
| 117 | 117 | throw new ClockifyException('Invalid "page" parameter'); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - if (isset($params['page-size']) && (!is_int($params['page-size']) || $params['page-size'] < 1)) { |
|
| 120 | + if (isset($params[ 'page-size' ]) && (!is_int($params[ 'page-size' ]) || $params[ 'page-size' ] < 1)) { |
|
| 121 | 121 | throw new ClockifyException('Invalid "page-size" parameter'); |
| 122 | 122 | } |
| 123 | 123 | |